diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/service/BestillingMalServiceTest.java b/apps/dolly-backend/src/test/java/no/nav/dolly/service/BestillingMalServiceTest.java index 456e7747d66..939eb4042e7 100644 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/service/BestillingMalServiceTest.java +++ b/apps/dolly-backend/src/test/java/no/nav/dolly/service/BestillingMalServiceTest.java @@ -22,7 +22,6 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.ComponentScan; -import org.springframework.data.domain.Sort; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MockMvc; import org.springframework.transaction.annotation.Transactional; @@ -44,7 +43,7 @@ @SpringBootTest(webEnvironment = RANDOM_PORT) @ActiveProfiles("test") -@Testcontainers(disabledWithoutDocker = true) +@Testcontainers(disabledWithoutDocker = true, parallel = true) @EnableAutoConfiguration @ComponentScan("no.nav.dolly") @AutoConfigureMockMvc(addFilters = false) @@ -99,10 +98,8 @@ public void beforeEach() { MockedJwtAuthenticationTokenUtils.setJwtAuthenticationToken(); } - @Transactional @AfterEach public void afterEach() { - deleteAllDatabaseContent(); MockedJwtAuthenticationTokenUtils.clearJwtAuthenticationToken(); } @@ -219,14 +216,4 @@ Testgruppe saveDummyGruppe() { void saveDummyBruker(Bruker bruker) { brukerRepository.save(bruker); } - - void deleteAllDatabaseContent() { - bestillingMalRepository.deleteAll(); - identRepository.deleteAll(); - bestillingRepository.deleteAll(); - brukerFavoritterRepository.deleteAll(); - testgruppeRepository.findAll(Sort.unsorted()).forEach(gruppe -> testgruppeRepository.deleteTestgruppeById(gruppe.getId())); - brukerRepository.deleteByBrukerId(DUMMY_EN.getBrukerId()); - brukerRepository.deleteByBrukerId(DUMMY_TO.getBrukerId()); - } } \ No newline at end of file