diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/DisableAutomaticFlywayMigrationOnStartup.java b/apps/dolly-backend/src/test/java/no/nav/dolly/DisableAutomaticFlywayMigrationOnStartup.java deleted file mode 100644 index 36303c00a1..0000000000 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/DisableAutomaticFlywayMigrationOnStartup.java +++ /dev/null @@ -1,20 +0,0 @@ -package no.nav.dolly; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -@Slf4j -public class DisableAutomaticFlywayMigrationOnStartup { - - @Bean - public FlywayMigrationStrategy flywayMigrationStrategy() { - log.info("Disabling automatic Flyway migration on startup"); - return flyway -> { - // Run flyway migration manually as needed. - }; - } - -} diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/AbstractControllerTest.java b/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/AbstractControllerTest.java index 1d084a8f13..0b3d816196 100644 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/AbstractControllerTest.java +++ b/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/AbstractControllerTest.java @@ -8,7 +8,6 @@ import no.nav.dolly.repository.BrukerRepository; import no.nav.dolly.repository.IdentRepository; import no.nav.dolly.repository.TestgruppeRepository; -import org.flywaydb.core.Flyway; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.extension.ExtendWith; @@ -20,7 +19,6 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.testcontainers.junit.jupiter.Testcontainers; import java.time.LocalDate; import java.util.Optional; @@ -33,7 +31,6 @@ @SpringBootTest(webEnvironment = RANDOM_PORT) @ExtendWith(SpringExtension.class) @ActiveProfiles("test") -@Testcontainers(disabledWithoutDocker = true) @AutoConfigureMockMvc(addFilters = false) @AutoConfigureWireMock(port = 0) public abstract class AbstractControllerTest { @@ -44,8 +41,6 @@ public abstract class AbstractControllerTest { private TestgruppeRepository testgruppeRepository; @Autowired private IdentRepository identRepository; - @Autowired - private Flyway flyway; @MockitoBean @SuppressWarnings("unused") diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/MalBestillingControllerTest.java b/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/MalBestillingControllerTest.java index 34e5270f23..7f1e6c8468 100644 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/MalBestillingControllerTest.java +++ b/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/MalBestillingControllerTest.java @@ -18,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.bean.override.mockito.MockitoBean; @@ -76,9 +75,6 @@ class MalBestillingControllerTest { @Autowired private MockMvc mockMvc; - @Autowired - private TestRestTemplate restTemplate; - @Autowired private BestillingMalRepository bestillingMalRepository; diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/TestgruppeControllerPostTest.java b/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/TestgruppeControllerPostTest.java index 4506df6fff..0601cbca90 100644 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/TestgruppeControllerPostTest.java +++ b/apps/dolly-backend/src/test/java/no/nav/dolly/provider/api/TestgruppeControllerPostTest.java @@ -185,8 +185,8 @@ void createBestilling() .build()) .build()) .build(); - mockMvc - .perform( + + mockMvc.perform( post("/api/v1/gruppe/{gruppeId}/bestilling", testgruppe.getId()) .contentType(APPLICATION_JSON) .content(objectMapper.writeValueAsString(bestilling))) diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/service/OrganisasjonMalBestillingServiceTest.java b/apps/dolly-backend/src/test/java/no/nav/dolly/service/OrganisasjonMalBestillingServiceTest.java index 841bee03b1..427b63bd8d 100644 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/service/OrganisasjonMalBestillingServiceTest.java +++ b/apps/dolly-backend/src/test/java/no/nav/dolly/service/OrganisasjonMalBestillingServiceTest.java @@ -9,7 +9,6 @@ import no.nav.dolly.repository.OrganisasjonBestillingMalRepository; import no.nav.dolly.repository.OrganisasjonBestillingRepository; import no.nav.testnav.libs.servletsecurity.exchange.AzureAdTokenService; -import org.flywaydb.core.Flyway; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -25,8 +24,6 @@ import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; -import org.springframework.transaction.annotation.Transactional; -import org.testcontainers.junit.jupiter.Testcontainers; import java.time.LocalDateTime; @@ -45,7 +42,6 @@ ) @ExtendWith(SpringExtension.class) @ActiveProfiles("test") -@Testcontainers(disabledWithoutDocker = true) @AutoConfigureMockMvc(addFilters = false) @AutoConfigureWireMock(port = 0) class OrganisasjonMalBestillingServiceTest { @@ -86,13 +82,9 @@ class OrganisasjonMalBestillingServiceTest { private OrganisasjonBestillingRepository organisasjonBestillingRepository; @Autowired private BrukerRepository brukerRepository; - @Autowired - private Flyway flyway; @BeforeEach - @Transactional public void beforeEach() { - flyway.migrate(); saveDummyBruker(DUMMY_EN); saveDummyBruker(DUMMY_TO); MockedJwtAuthenticationTokenUtils.setJwtAuthenticationToken(); diff --git a/apps/dolly-backend/src/test/resources/application-test.yml b/apps/dolly-backend/src/test/resources/application-test.yml index 5f6e9a37f0..bd483aa7a4 100644 --- a/apps/dolly-backend/src/test/resources/application-test.yml +++ b/apps/dolly-backend/src/test/resources/application-test.yml @@ -93,9 +93,6 @@ management: include: none spring: - jpa: - hibernate: - ddl-auto: create cloud: gcp: secretmanager: