Skip to content

Commit

Permalink
fix: delete quickstart entity at the end of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huglx committed Jul 14, 2024
1 parent 8e72194 commit fd2bdf5
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import io.tolgee.CleanDbBeforeClass
import io.tolgee.commandLineRunners.InitialUserCreatorCommandLineRunner
import io.tolgee.component.fileStorage.FileStorage
import io.tolgee.configuration.tolgee.TolgeeProperties
import io.tolgee.model.Project
import io.tolgee.model.enums.OrganizationRoleType
import io.tolgee.repository.QuickStartRepository
import io.tolgee.repository.UserAccountRepository
import io.tolgee.security.InitialPasswordManager
import io.tolgee.service.project.ProjectService
Expand Down Expand Up @@ -64,6 +64,9 @@ class CreateEnabledTest : AbstractTransactionalTest() {
@Autowired
lateinit var projectService: ProjectService

@Autowired
lateinit var quickStartRepository: QuickStartRepository

@BeforeAll
fun callTheRunner() {
initialUserCreatorCommandLineRunner.run()
Expand All @@ -76,7 +79,7 @@ class CreateEnabledTest : AbstractTransactionalTest() {
assertThat(johny.organizationRoles[0].type).isEqualTo(OrganizationRoleType.OWNER)
val organization = johny.organizationRoles[0].organization!!
val projects = projectService.findAllInOrganization(organizationId = organization.id)
assertThat(projects).contains(Project(name = "Demo project"))
assertThat(projects[0].name).isEqualTo("Demo project")
}

@Test
Expand Down Expand Up @@ -125,7 +128,7 @@ class CreateEnabledTest : AbstractTransactionalTest() {
fun cleanUp() {
(fileStorage as InMemoryFileStorage).clear()
resetInitialPassword()

quickStartRepository.deleteAll()
val initial = userAccountService.findActive("johny")!!
userAccountRepository.delete(initial)
}
Expand Down

0 comments on commit fd2bdf5

Please sign in to comment.