Skip to content

Commit

Permalink
Plugin datatransfer: test cases fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreinhard committed Aug 9, 2023
1 parent 5f22030 commit 20492b4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ package org.projectforge.plugins.datatransfer
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.mockito.Mockito
import org.projectforge.framework.persistence.jpa.MyJpaWithExtLibrariesScanner
import org.projectforge.framework.persistence.user.entities.PFUserDO
import org.projectforge.jcr.FileObject
import org.projectforge.plugins.datatransfer.rest.DataTransferPageRest
Expand All @@ -48,10 +47,7 @@ class DataTransferAccessTest : AbstractTestBase() {
private var initialized = false

init {
MyJpaWithExtLibrariesScanner.addPluginEntitiesForTestMode(
DataTransferAreaDO::class.java.canonicalName,
DataTransferAuditDO::class.java.canonicalName,
)
DataTransferTestService.addPluginEntitiesForTestMode()
}

@PostConstruct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ package org.projectforge.plugins.datatransfer
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.projectforge.framework.jcr.AttachmentsEventType
import org.projectforge.framework.persistence.jpa.MyJpaWithExtLibrariesScanner
import org.projectforge.framework.time.PFDateTime
import org.projectforge.test.AbstractTestBase
import org.springframework.beans.factory.annotation.Autowired
Expand All @@ -43,10 +42,7 @@ class DataTransferAuditDaoTest : AbstractTestBase() {
private lateinit var dataTransferAreaDao: DataTransferAreaDao

init {
MyJpaWithExtLibrariesScanner.addPluginEntitiesForTestMode(
DataTransferAreaDO::class.java.canonicalName,
DataTransferAuditDO::class.java.canonicalName,
)
DataTransferTestService.addPluginEntitiesForTestMode()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package org.projectforge.plugins.datatransfer

import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.projectforge.framework.persistence.jpa.MyJpaWithExtLibrariesScanner
import org.projectforge.jcr.FileObject
import org.projectforge.jcr.RepoService
import org.projectforge.plugins.datatransfer.rest.DataTransferAreaPagesRest
Expand All @@ -51,8 +50,7 @@ class DataTransferJCRCleanUpJobTest : AbstractTestBase() {
private lateinit var dataTransferTestService: DataTransferTestService

init {
MyJpaWithExtLibrariesScanner.addPluginEntitiesForTestMode(DataTransferAreaDO::class.java.canonicalName, DataTransferAuditDO::class.java.canonicalName)
initJCRTestRepo(MODUL_NAME, "cleanUpTestRepo")
DataTransferTestService.addPluginEntitiesForTestMode()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import org.junit.jupiter.api.Test
import org.projectforge.business.configuration.DomainService
import org.projectforge.framework.jcr.Attachment
import org.projectforge.framework.jcr.AttachmentsEventType
import org.projectforge.framework.persistence.jpa.MyJpaWithExtLibrariesScanner
import org.projectforge.framework.persistence.user.entities.PFUserDO
import org.projectforge.framework.time.PFDateTime
import org.projectforge.jcr.FileInfo
Expand All @@ -50,10 +49,7 @@ class DataTransferNotificationMailTest : AbstractTestBase() {
private lateinit var dataTransferNotificationMailService: DataTransferNotificationMailService

init {
MyJpaWithExtLibrariesScanner.addPluginEntitiesForTestMode(
DataTransferAreaDO::class.java.canonicalName,
DataTransferAuditDO::class.java.canonicalName,
)
DataTransferTestService.addPluginEntitiesForTestMode()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.mockito.Mockito
import org.projectforge.framework.jcr.AttachmentsService
import org.projectforge.framework.persistence.jpa.MyJpaWithExtLibrariesScanner
import org.projectforge.jcr.FileObject
import org.projectforge.plugins.datatransfer.restPublic.DataTransferPublicPageRest
import org.projectforge.plugins.datatransfer.restPublic.DataTransferPublicServicesRest
Expand Down Expand Up @@ -57,7 +56,7 @@ class DataTransferPublicAccessTest : AbstractTestBase() {
private lateinit var dataTransferPublicSession: DataTransferPublicSession

init {
MyJpaWithExtLibrariesScanner.addPluginEntitiesForTestMode(DataTransferAreaDO::class.java.canonicalName)
DataTransferTestService.addPluginEntitiesForTestMode()
}

@PostConstruct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class DataTransferTestService {
private lateinit var pluginAdminService: PluginAdminService

init {
MyJpaWithExtLibrariesScanner.addPluginEntitiesForTestMode(DataTransferAreaDO::class.java.canonicalName)
addPluginEntitiesForTestMode()
}

@PostConstruct
Expand Down Expand Up @@ -150,6 +150,13 @@ class DataTransferTestService {
}

companion object {
internal fun addPluginEntitiesForTestMode() {
MyJpaWithExtLibrariesScanner.addPluginEntitiesForTestMode(
DataTransferAreaDO::class.java.canonicalName,
DataTransferAuditDO::class.java.canonicalName,
)
}

internal fun checkZipArchive(byteArray: ByteArray): List<String> {
val result = mutableListOf<String>()
ZipInputStream(ByteArrayInputStream(byteArray)).use {
Expand Down

0 comments on commit 20492b4

Please sign in to comment.