diff --git a/apps/kodeverk-service/src/test/java/no/nav/testnav/kodeverkservice/ApplicationContextTest.java b/apps/kodeverk-service/src/test/java/no/nav/testnav/kodeverkservice/ApplicationContextTest.java index f277d06fc62..1a47ec0703f 100644 --- a/apps/kodeverk-service/src/test/java/no/nav/testnav/kodeverkservice/ApplicationContextTest.java +++ b/apps/kodeverk-service/src/test/java/no/nav/testnav/kodeverkservice/ApplicationContextTest.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -13,7 +13,7 @@ @ActiveProfiles("test") public class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/levende-arbeidsforhold-ansettelse/src/test/java/no/nav/testnav/levendearbeidsforholdansettelse/LevendeArbeidsforholdAnsettelseApplicationTests.java b/apps/levende-arbeidsforhold-ansettelse/src/test/java/no/nav/testnav/levendearbeidsforholdansettelse/LevendeArbeidsforholdAnsettelseApplicationTests.java index bfc00a93a64..d594719970f 100644 --- a/apps/levende-arbeidsforhold-ansettelse/src/test/java/no/nav/testnav/levendearbeidsforholdansettelse/LevendeArbeidsforholdAnsettelseApplicationTests.java +++ b/apps/levende-arbeidsforhold-ansettelse/src/test/java/no/nav/testnav/levendearbeidsforholdansettelse/LevendeArbeidsforholdAnsettelseApplicationTests.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.data.r2dbc.core.R2dbcEntityTemplate; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -14,7 +14,7 @@ @ActiveProfiles("test") class LevendeArbeidsforholdAnsettelseApplicationTests { - @MockBean + @MockitoBean @SuppressWarnings("unused") public ReactiveJwtDecoder jwtDecoder; diff --git a/apps/levende-arbeidsforhold-service/build.gradle b/apps/levende-arbeidsforhold-service/build.gradle index 1ff86f414b6..d5e6a11f670 100644 --- a/apps/levende-arbeidsforhold-service/build.gradle +++ b/apps/levende-arbeidsforhold-service/build.gradle @@ -10,7 +10,7 @@ sonarqube { } dependencies { - implementation "io.confluent:kafka-avro-serializer:$versions.avro" + implementation "io.confluent:kafka-avro-serializer:$versions.avroSerializer" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" implementation "no.nav.testnav.libs:avro-schema" diff --git a/apps/levende-arbeidsforhold-service/src/test/java/no/nav/testnav/levendearbeidsforholdservice/ApplicationContextTest.java b/apps/levende-arbeidsforhold-service/src/test/java/no/nav/testnav/levendearbeidsforholdservice/ApplicationContextTest.java index 8f3a5ea5356..88a06cb2150 100644 --- a/apps/levende-arbeidsforhold-service/src/test/java/no/nav/testnav/levendearbeidsforholdservice/ApplicationContextTest.java +++ b/apps/levende-arbeidsforhold-service/src/test/java/no/nav/testnav/levendearbeidsforholdservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/miljoer-service/src/test/java/no/nav/registre/testnorge/miljoerservice/ApplicationContextTest.java b/apps/miljoer-service/src/test/java/no/nav/registre/testnorge/miljoerservice/ApplicationContextTest.java index 44ecb7599b0..60263185d10 100644 --- a/apps/miljoer-service/src/test/java/no/nav/registre/testnorge/miljoerservice/ApplicationContextTest.java +++ b/apps/miljoer-service/src/test/java/no/nav/registre/testnorge/miljoerservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @SpringBootTest public class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/organisasjon-bestilling-service/src/test/java/no/nav/testnav/apps/organisasjonbestillingservice/ApplicationContextTest.java b/apps/organisasjon-bestilling-service/src/test/java/no/nav/testnav/apps/organisasjonbestillingservice/ApplicationContextTest.java index 0a3ef843ece..36f61cbfaa3 100644 --- a/apps/organisasjon-bestilling-service/src/test/java/no/nav/testnav/apps/organisasjonbestillingservice/ApplicationContextTest.java +++ b/apps/organisasjon-bestilling-service/src/test/java/no/nav/testnav/apps/organisasjonbestillingservice/ApplicationContextTest.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -11,7 +11,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/organisasjon-faste-data-service/build.gradle b/apps/organisasjon-faste-data-service/build.gradle index 20a603b65d3..d4cc105df58 100644 --- a/apps/organisasjon-faste-data-service/build.gradle +++ b/apps/organisasjon-faste-data-service/build.gradle @@ -26,7 +26,7 @@ dependencies { implementation "org.springframework.boot:spring-boot-starter-data-jpa" implementation "jakarta.validation:jakarta.validation-api:$versions.jakartaValidation" - implementation "io.confluent:kafka-avro-serializer:$versions.avro" + implementation "io.confluent:kafka-avro-serializer:$versions.avroSerializer" implementation "org.flywaydb:flyway-core" implementation "org.flywaydb:flyway-database-postgresql" diff --git a/apps/organisasjon-faste-data-service/src/test/java/no/nav/registre/testnorge/organisasjonfastedataservice/ApplicationContextTest.java b/apps/organisasjon-faste-data-service/src/test/java/no/nav/registre/testnorge/organisasjonfastedataservice/ApplicationContextTest.java index ba30cd1d952..7964d929627 100644 --- a/apps/organisasjon-faste-data-service/src/test/java/no/nav/registre/testnorge/organisasjonfastedataservice/ApplicationContextTest.java +++ b/apps/organisasjon-faste-data-service/src/test/java/no/nav/registre/testnorge/organisasjonfastedataservice/ApplicationContextTest.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -11,7 +11,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/organisasjon-forvalter/src/test/java/no/nav/organisasjonforvalter/ApplicationContextTest.java b/apps/organisasjon-forvalter/src/test/java/no/nav/organisasjonforvalter/ApplicationContextTest.java index 28a222eebd2..33c1e2df9a0 100644 --- a/apps/organisasjon-forvalter/src/test/java/no/nav/organisasjonforvalter/ApplicationContextTest.java +++ b/apps/organisasjon-forvalter/src/test/java/no/nav/organisasjonforvalter/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; @Test diff --git a/apps/organisasjon-mottak-service/build.gradle b/apps/organisasjon-mottak-service/build.gradle index 80a0eee1e24..5912584d08a 100644 --- a/apps/organisasjon-mottak-service/build.gradle +++ b/apps/organisasjon-mottak-service/build.gradle @@ -29,7 +29,7 @@ dependencies { implementation "org.springframework.kafka:spring-kafka" implementation "org.apache.httpcomponents.core5:httpcore5:5.3" implementation "org.apache.kafka:kafka-clients:$versions.apacheKafka" - implementation "io.confluent:kafka-avro-serializer:$versions.avro" + implementation "io.confluent:kafka-avro-serializer:$versions.avroSerializer" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" diff --git a/apps/organisasjon-mottak-service/src/test/java/no/nav/registre/testnorge/organisasjonmottak/ApplicationContextTest.java b/apps/organisasjon-mottak-service/src/test/java/no/nav/registre/testnorge/organisasjonmottak/ApplicationContextTest.java index c34645a7afd..485ea566e0a 100644 --- a/apps/organisasjon-mottak-service/src/test/java/no/nav/registre/testnorge/organisasjonmottak/ApplicationContextTest.java +++ b/apps/organisasjon-mottak-service/src/test/java/no/nav/registre/testnorge/organisasjonmottak/ApplicationContextTest.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -13,7 +13,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private JwtDecoder jwtDecoder; diff --git a/apps/organisasjon-service/src/test/java/no/nav/registre/testnorge/organisasjonservice/ApplicationContextTest.java b/apps/organisasjon-service/src/test/java/no/nav/registre/testnorge/organisasjonservice/ApplicationContextTest.java index b5cebbd5b6b..b9f63bc34a5 100644 --- a/apps/organisasjon-service/src/test/java/no/nav/registre/testnorge/organisasjonservice/ApplicationContextTest.java +++ b/apps/organisasjon-service/src/test/java/no/nav/registre/testnorge/organisasjonservice/ApplicationContextTest.java @@ -3,7 +3,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.TestPropertySource; @@ -17,7 +17,7 @@ @TestPropertySource(locations = "classpath:application-test.yml") public class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private JwtDecoder jwtDecoder; diff --git a/apps/orgnummer-service/src/test/java/no/nav/registre/orgnrservice/ApplicationContextTest.java b/apps/orgnummer-service/src/test/java/no/nav/registre/orgnrservice/ApplicationContextTest.java index 96a45c6acd5..4e92c0eae0e 100644 --- a/apps/orgnummer-service/src/test/java/no/nav/registre/orgnrservice/ApplicationContextTest.java +++ b/apps/orgnummer-service/src/test/java/no/nav/registre/orgnrservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/person-faste-data-service/src/test/java/no/nav/testnav/personfastedataservice/ApplicationContextTest.java b/apps/person-faste-data-service/src/test/java/no/nav/testnav/personfastedataservice/ApplicationContextTest.java index cb9ba64e65d..7b7670a554b 100644 --- a/apps/person-faste-data-service/src/test/java/no/nav/testnav/personfastedataservice/ApplicationContextTest.java +++ b/apps/person-faste-data-service/src/test/java/no/nav/testnav/personfastedataservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public ReactiveJwtDecoder jwtDecoder; @Test diff --git a/apps/person-search-service/src/test/java/no/nav/registre/testnorge/personsearchservice/ApplicationContextTest.java b/apps/person-search-service/src/test/java/no/nav/registre/testnorge/personsearchservice/ApplicationContextTest.java index 821f8f6468b..470fae490e5 100644 --- a/apps/person-search-service/src/test/java/no/nav/registre/testnorge/personsearchservice/ApplicationContextTest.java +++ b/apps/person-search-service/src/test/java/no/nav/registre/testnorge/personsearchservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/person-service/src/test/java/no/nav/testnav/apps/personservice/ApplicationContextTest.java b/apps/person-service/src/test/java/no/nav/testnav/apps/personservice/ApplicationContextTest.java index 369d96f7540..04095b297ca 100644 --- a/apps/person-service/src/test/java/no/nav/testnav/apps/personservice/ApplicationContextTest.java +++ b/apps/person-service/src/test/java/no/nav/testnav/apps/personservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/profil-api/src/test/java/no/nav/registre/testnorge/profil/ApplicationContextTest.java b/apps/profil-api/src/test/java/no/nav/registre/testnorge/profil/ApplicationContextTest.java index 42873bbb9e3..80c0cd96d96 100644 --- a/apps/profil-api/src/test/java/no/nav/registre/testnorge/profil/ApplicationContextTest.java +++ b/apps/profil-api/src/test/java/no/nav/registre/testnorge/profil/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/sykemelding-api/src/test/java/no/nav/registre/testnorge/sykemelding/ApplicationContextTest.java b/apps/sykemelding-api/src/test/java/no/nav/registre/testnorge/sykemelding/ApplicationContextTest.java index caccc80f09d..3d0c5b70f54 100644 --- a/apps/sykemelding-api/src/test/java/no/nav/registre/testnorge/sykemelding/ApplicationContextTest.java +++ b/apps/sykemelding-api/src/test/java/no/nav/registre/testnorge/sykemelding/ApplicationContextTest.java @@ -3,14 +3,14 @@ import no.nav.testnav.libs.servletsecurity.exchange.TokenExchange; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.context.ActiveProfiles; @SpringBootTest @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean private TokenExchange tokenExchange; @Test diff --git a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/ArbeidsforholdConsumerTest.java b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/ArbeidsforholdConsumerTest.java index da2d3262e83..faaa4c1b980 100644 --- a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/ArbeidsforholdConsumerTest.java +++ b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/ArbeidsforholdConsumerTest.java @@ -13,7 +13,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -36,10 +36,10 @@ @AutoConfigureWireMock(port = 0) public class ArbeidsforholdConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenService; @Autowired diff --git a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/HelsepersonellConsumerTest.java b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/HelsepersonellConsumerTest.java index 06e4636c8d3..9706a316e35 100644 --- a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/HelsepersonellConsumerTest.java +++ b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/HelsepersonellConsumerTest.java @@ -13,7 +13,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -36,10 +36,10 @@ @AutoConfigureWireMock(port = 0) public class HelsepersonellConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenService; @Autowired diff --git a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/OrganisasjonConsumerTest.java b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/OrganisasjonConsumerTest.java index c4d5863f604..d21ca33fa61 100644 --- a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/OrganisasjonConsumerTest.java +++ b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/OrganisasjonConsumerTest.java @@ -13,7 +13,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -36,10 +36,10 @@ @AutoConfigureWireMock(port = 0) public class OrganisasjonConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenService; @Autowired diff --git a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/PdlProxyConsumerTest.java b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/PdlProxyConsumerTest.java index e41ca52e23e..0eb0b626fa2 100644 --- a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/PdlProxyConsumerTest.java +++ b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/PdlProxyConsumerTest.java @@ -13,7 +13,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -36,10 +36,10 @@ @AutoConfigureWireMock(port = 0) public class PdlProxyConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenService; @Autowired diff --git a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SykemeldingConsumerTest.java b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SykemeldingConsumerTest.java index 9ba6c0c1b47..b8ea13c8643 100644 --- a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SykemeldingConsumerTest.java +++ b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SykemeldingConsumerTest.java @@ -23,7 +23,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -56,10 +56,10 @@ @AutoConfigureWireMock(port = 0) public class SykemeldingConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenService; @Autowired diff --git a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SyntElsamConsumerTest.java b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SyntElsamConsumerTest.java index e568818dcc9..3c1f82e6d86 100644 --- a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SyntElsamConsumerTest.java +++ b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SyntElsamConsumerTest.java @@ -13,7 +13,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -39,10 +39,10 @@ @AutoConfigureWireMock(port = 0) public class SyntElsamConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenService; @Autowired diff --git a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/provider/SyntSykemeldingControllerIntegrationTest.java b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/provider/SyntSykemeldingControllerIntegrationTest.java index 21bf2d37dc4..a13b0b66fd6 100644 --- a/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/provider/SyntSykemeldingControllerIntegrationTest.java +++ b/apps/synt-sykemelding-api/src/test/java/no/nav/testnav/apps/syntsykemeldingapi/provider/SyntSykemeldingControllerIntegrationTest.java @@ -14,7 +14,7 @@ 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.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -41,7 +41,7 @@ @AutoConfigureWireMock(port = 0) class SyntSykemeldingControllerIntegrationTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private JwtDecoder jwtDecoder; @@ -51,22 +51,22 @@ class SyntSykemeldingControllerIntegrationTest { @Autowired private ObjectMapper objectMapper; - @MockBean + @MockitoBean private TokenExchange tokenExchange; - @MockBean + @MockitoBean private PdlProxyConsumer pdlProxyConsumer; - @MockBean + @MockitoBean private ArbeidsforholdConsumer arbeidsforholdConsumer; - @MockBean + @MockitoBean private OrganisasjonConsumer organisasjonConsumer; - @MockBean + @MockitoBean private HelsepersonellConsumer helsepersonellConsumer; - @MockBean + @MockitoBean private SykemeldingConsumer sykemeldingConsumer; @BeforeEach diff --git a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/ApplicationContextTest.java b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/ApplicationContextTest.java index 80ae5ae509b..c67b66e6599 100644 --- a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/ApplicationContextTest.java +++ b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Test diff --git a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/ArenaForvalterConsumerTest.java b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/ArenaForvalterConsumerTest.java index a37b8a6e2f3..5e1c3ba4c1b 100644 --- a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/ArenaForvalterConsumerTest.java +++ b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/ArenaForvalterConsumerTest.java @@ -12,7 +12,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -38,10 +38,10 @@ @AutoConfigureWireMock(port = 0) class ArenaForvalterConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenExchange; @Autowired diff --git a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PdlConsumerTest.java b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PdlConsumerTest.java index bf6f7fe9a56..444f92b7e9e 100644 --- a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PdlConsumerTest.java +++ b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PdlConsumerTest.java @@ -9,7 +9,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -37,10 +37,10 @@ @AutoConfigureWireMock(port = 0) class PdlConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenExchange; @Autowired diff --git a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PensjonTestdataFacadeConsumerTest.java b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PensjonTestdataFacadeConsumerTest.java index 0469281914c..708bfc15ac6 100644 --- a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PensjonTestdataFacadeConsumerTest.java +++ b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PensjonTestdataFacadeConsumerTest.java @@ -11,7 +11,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -30,10 +30,10 @@ @AutoConfigureWireMock(port = 0) class PensjonTestdataFacadeConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenExchange; @Autowired diff --git a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PersonSearchConsumerTest.java b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PersonSearchConsumerTest.java index 6c751b0220b..fe5b688e072 100644 --- a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PersonSearchConsumerTest.java +++ b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PersonSearchConsumerTest.java @@ -10,7 +10,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -31,10 +31,10 @@ @AutoConfigureWireMock(port = 0) class PersonSearchConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenExchange; @Autowired diff --git a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntVedtakshistorikkConsumerTest.java b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntVedtakshistorikkConsumerTest.java index fe0a771cac3..48dce227bc8 100644 --- a/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntVedtakshistorikkConsumerTest.java +++ b/apps/synt-vedtakshistorikk-service/src/test/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntVedtakshistorikkConsumerTest.java @@ -9,7 +9,7 @@ import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -29,10 +29,10 @@ @AutoConfigureWireMock(port = 0) class SyntVedtakshistorikkConsumerTest { - @MockBean + @MockitoBean private JwtDecoder jwtDecoder; - @MockBean + @MockitoBean private TokenExchange tokenExchange; @Autowired diff --git a/apps/tenor-search-service/src/test/java/no/nav/testnav/apps/tenorsearchservice/ApplicationContextTest.java b/apps/tenor-search-service/src/test/java/no/nav/testnav/apps/tenorsearchservice/ApplicationContextTest.java index 058647bcc69..a579c9a2004 100644 --- a/apps/tenor-search-service/src/test/java/no/nav/testnav/apps/tenorsearchservice/ApplicationContextTest.java +++ b/apps/tenor-search-service/src/test/java/no/nav/testnav/apps/tenorsearchservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -10,7 +10,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean public ReactiveJwtDecoder jwtDecoder; @Test diff --git a/apps/testnav-ident-pool/src/test/java/no/nav/testnav/identpool/ComponentTestConfig.java b/apps/testnav-ident-pool/src/test/java/no/nav/testnav/identpool/ComponentTestConfig.java index c8b8c1e41c8..0e706234f05 100644 --- a/apps/testnav-ident-pool/src/test/java/no/nav/testnav/identpool/ComponentTestConfig.java +++ b/apps/testnav-ident-pool/src/test/java/no/nav/testnav/identpool/ComponentTestConfig.java @@ -1,7 +1,7 @@ package no.nav.testnav.identpool; import no.nav.testnav.identpool.ajourhold.CronJobService; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.security.oauth2.jwt.JwtDecoder; @@ -10,9 +10,9 @@ @ComponentScan(basePackages = "no.nav.testnav.identpool") public class ComponentTestConfig { - @MockBean + @MockitoBean protected JwtDecoder jwtDecoder; - @MockBean + @MockitoBean protected CronJobService cronJobService; } diff --git a/apps/testnav-ident-pool/src/test/java/no/nav/testnav/identpool/ComponentTestbase.java b/apps/testnav-ident-pool/src/test/java/no/nav/testnav/identpool/ComponentTestbase.java index 8c4e5ca5151..c004d1aad48 100644 --- a/apps/testnav-ident-pool/src/test/java/no/nav/testnav/identpool/ComponentTestbase.java +++ b/apps/testnav-ident-pool/src/test/java/no/nav/testnav/identpool/ComponentTestbase.java @@ -12,7 +12,7 @@ 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.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -49,7 +49,7 @@ public abstract class ComponentTestbase { @Autowired protected ObjectMapper objectMapper; - @MockBean + @MockitoBean protected TpsMessagingConsumer tpsMessagingConsumer; private HttpEntityBuilder httpEntityBuilder; diff --git a/apps/testnorge-statisk-data-forvalter/build.gradle b/apps/testnorge-statisk-data-forvalter/build.gradle index 27ec15bee1a..892b0ce988e 100644 --- a/apps/testnorge-statisk-data-forvalter/build.gradle +++ b/apps/testnorge-statisk-data-forvalter/build.gradle @@ -24,7 +24,7 @@ dependencies { implementation "no.nav.testnav.libs:vault" implementation "org.springframework.kafka:spring-kafka" - implementation "io.confluent:kafka-avro-serializer:$versions.avro" + implementation "io.confluent:kafka-avro-serializer:$versions.avroSerializer" implementation "org.springframework.boot:spring-boot-starter-data-jpa" implementation "org.springframework.boot:spring-boot-starter-web" @@ -42,8 +42,8 @@ dependencies { implementation "org.flywaydb:flyway-database-postgresql" implementation "com.h2database:h2" - - implementation "org.apache.httpcomponents.client5:httpclient5:5.3.1" + + implementation "org.apache.httpcomponents.client5:httpclient5:5.4.1" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" implementation "com.squareup.okhttp3:okhttp:$versions.okhttp" diff --git a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/JwtDecoderConfig.java b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/JwtDecoderConfig.java index 0114dc57053..a2e3ac971ff 100644 --- a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/JwtDecoderConfig.java +++ b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/JwtDecoderConfig.java @@ -1,23 +1,19 @@ package no.nav.registre.sdforvalter; -import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.mockito.Mockito; +import org.springframework.boot.test.context.TestConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.context.annotation.Profile; import org.springframework.security.oauth2.jwt.JwtDecoder; -@Configuration -@Slf4j +@TestConfiguration +@Profile("test") public class JwtDecoderConfig { - @MockBean - @SuppressWarnings("unused") - private JwtDecoder jwtDecoder; - @Bean + @Primary public JwtDecoder jwtDecoder() { - log.info("Using a mocked JwtDecoder"); - return jwtDecoder; + return Mockito.mock(JwtDecoder.class); } - -} +} \ No newline at end of file diff --git a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/OrkestreringControllerAaregIntegrationTest.java b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/OrkestreringControllerAaregIntegrationTest.java index 20631055417..c45e01d9b7d 100644 --- a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/OrkestreringControllerAaregIntegrationTest.java +++ b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/OrkestreringControllerAaregIntegrationTest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import no.nav.registre.sdforvalter.JwtDecoderConfig; import no.nav.registre.sdforvalter.consumer.rs.aareg.request.RsAaregSyntetiseringsRequest; import no.nav.registre.sdforvalter.consumer.rs.kodeverk.response.KodeverkResponse; import no.nav.registre.sdforvalter.database.model.AaregModel; @@ -15,14 +16,17 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; 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.mock.mockito.MockBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; +import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; 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.springframework.test.web.servlet.MockMvc; import reactor.core.publisher.Mono; @@ -39,12 +43,13 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest( - webEnvironment = RANDOM_PORT, - properties = "spring.cloud.vault.token=SET_TO_SOMETHING_TO_ALLOW_CONTEXT_TO_LOAD" + webEnvironment = RANDOM_PORT ) +@ExtendWith(SpringExtension.class) @ActiveProfiles("test") -@AutoConfigureWireMock(port = 0) @AutoConfigureMockMvc +@AutoConfigureWireMock(port = 0) +@Import(JwtDecoderConfig.class) class OrkestreringControllerAaregIntegrationTest { private static final String FNR = "01010101010"; @@ -54,9 +59,10 @@ class OrkestreringControllerAaregIntegrationTest { private final KodeverkResponse kodeverkResponse = new KodeverkResponse(Collections.singletonList("yrke")); private final TypeReference> syntResponse = new TypeReference<>() { }; + @Autowired private MockMvc mvc; - @MockBean + @MockitoBean private TokenExchange tokenExchange; @Autowired private AaregRepository aaregRepository; diff --git a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/OrkestreringControllerKrrIntegrationTest.java b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/OrkestreringControllerKrrIntegrationTest.java index 4fa4cb7f064..deade05b642 100644 --- a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/OrkestreringControllerKrrIntegrationTest.java +++ b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/OrkestreringControllerKrrIntegrationTest.java @@ -1,6 +1,7 @@ package no.nav.registre.sdforvalter.provider.rs; import com.fasterxml.jackson.databind.ObjectMapper; +import no.nav.registre.sdforvalter.JwtDecoderConfig; import no.nav.registre.sdforvalter.consumer.rs.krr.request.KrrRequest; import no.nav.registre.sdforvalter.database.model.KrrModel; import no.nav.registre.sdforvalter.database.repository.KrrRepository; @@ -8,14 +9,17 @@ import no.nav.testnav.libs.testing.JsonWiremockHelper; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; 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.cloud.contract.wiremock.AutoConfigureWireMock; +import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; import static com.github.tomakehurst.wiremock.client.WireMock.reset; @@ -25,12 +29,13 @@ @SpringBootTest( - webEnvironment = RANDOM_PORT, - properties = "spring.cloud.vault.token=SET_TO_SOMETHING_TO_ALLOW_CONTEXT_TO_LOAD" + webEnvironment = RANDOM_PORT ) +@ExtendWith(SpringExtension.class) @ActiveProfiles("test") @AutoConfigureWireMock(port = 0) @AutoConfigureMockMvc(addFilters = false) +@Import(JwtDecoderConfig.class) @DirtiesContext class OrkestreringControllerKrrIntegrationTest { diff --git a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1AaregIntegrationTest.java b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1AaregIntegrationTest.java index 8500e738703..eb8ea40a0ce 100644 --- a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1AaregIntegrationTest.java +++ b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1AaregIntegrationTest.java @@ -2,18 +2,22 @@ import com.fasterxml.jackson.databind.ObjectMapper; +import no.nav.registre.sdforvalter.JwtDecoderConfig; import no.nav.registre.sdforvalter.database.model.AaregModel; import no.nav.registre.sdforvalter.database.repository.AaregRepository; import no.nav.registre.sdforvalter.domain.Aareg; import no.nav.registre.sdforvalter.domain.AaregListe; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; 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.cloud.contract.wiremock.AutoConfigureWireMock; +import org.springframework.context.annotation.Import; import org.springframework.http.MediaType; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; import static org.assertj.core.api.Assertions.assertThat; @@ -23,12 +27,13 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest( - webEnvironment = RANDOM_PORT, - properties = "spring.cloud.vault.token=SET_TO_SOMETHING_TO_ALLOW_CONTEXT_TO_LOAD" + webEnvironment = RANDOM_PORT ) +@ExtendWith(SpringExtension.class) @ActiveProfiles("test") +@AutoConfigureMockMvc() @AutoConfigureWireMock(port = 0) -@AutoConfigureMockMvc +@Import(JwtDecoderConfig.class) class StaticDataControllerV1AaregIntegrationTest { @Autowired private MockMvc mvc; @@ -39,6 +44,18 @@ class StaticDataControllerV1AaregIntegrationTest { @Autowired private AaregRepository repository; + public AaregModel createAaregModel(String fnr, String orgnr) { + AaregModel model = new AaregModel(); + model.setFnr(fnr); + model.setOrgId(orgnr); + return model; + } + + @AfterEach + public void cleanUp() { + repository.deleteAll(); + } + @Test void shouldGetAareg() throws Exception { AaregModel model = createAaregModel("0101011236", "987654321"); @@ -54,18 +71,4 @@ void shouldGetAareg() throws Exception { assertThat(response.getListe()).containsOnly(new Aareg(model)); } - - public AaregModel createAaregModel(String fnr, String orgnr) { - AaregModel model = new AaregModel(); - model.setFnr(fnr); - model.setOrgId(orgnr); - return model; - } - - - @AfterEach - public void cleanUp() { - repository.deleteAll(); - } - } diff --git a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1EregIntegrationTest.java b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1EregIntegrationTest.java index 9df2d1dfb87..03bab37236b 100644 --- a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1EregIntegrationTest.java +++ b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1EregIntegrationTest.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Lists; +import no.nav.registre.sdforvalter.JwtDecoderConfig; import no.nav.registre.sdforvalter.database.model.EregModel; import no.nav.registre.sdforvalter.database.model.GruppeModel; import no.nav.registre.sdforvalter.database.model.OpprinnelseModel; @@ -15,12 +16,16 @@ import no.nav.registre.sdforvalter.domain.Opprinnelse; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; 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.cloud.contract.wiremock.AutoConfigureWireMock; +import org.springframework.context.annotation.Import; import org.springframework.http.MediaType; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; import java.util.ArrayList; @@ -34,11 +39,13 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest( - webEnvironment = RANDOM_PORT, - properties = "spring.cloud.vault.token=SET_TO_SOMETHING_TO_ALLOW_CONTEXT_TO_LOAD" + webEnvironment = RANDOM_PORT ) +@ExtendWith(SpringExtension.class) @ActiveProfiles("test") @AutoConfigureMockMvc() +@AutoConfigureWireMock(port = 0) +@Import(JwtDecoderConfig.class) class StaticDataControllerV1EregIntegrationTest { private static final String EREG_API = "/api/v1/faste-data/ereg"; @Autowired @@ -56,6 +63,50 @@ class StaticDataControllerV1EregIntegrationTest { @Autowired private GruppeRepository gruppeRepository; + @AfterEach + public void cleanUp() { + eregRepository.deleteAll(); + gruppeRepository.deleteAll(); + opprinnelseRepository.deleteAll(); + } + + private EregListe create(Ereg... eregs) { + return new EregListe(Arrays.asList(eregs)); + } + + private EregModel createEregModel(String orgnr, String enhetstype, GruppeModel gruppeModel) { + return createEregModel(orgnr, enhetstype, null, gruppeModel); + } + + private EregModel createEregModel(String orgnr, String enhetstype, OpprinnelseModel opprinnelseModel) { + return createEregModel(orgnr, enhetstype, opprinnelseModel, null); + } + + private EregModel createEregModel(String orgnr, String enhetstype, OpprinnelseModel opprinnelseModel, GruppeModel gruppeModel) { + EregModel model = new EregModel(); + model.setOrgnr(orgnr); + model.setEnhetstype(enhetstype); + model.setOpprinnelseModel(opprinnelseModel); + model.setGruppeModel(gruppeModel); + return model; + } + + private EregModel createEregModel(String orgnr, String enhetstype) { + return createEregModel(orgnr, enhetstype, null, null); + } + + private Ereg createEreg(String orgnr, String enhetstype, String opprinnelse) { + return new Ereg(createEregModel(orgnr, enhetstype, new OpprinnelseModel(opprinnelse)), new ArrayList<>()); + } + + private Ereg createEreg(String orgnr, String enhetstype, Gruppe gruppe) { + return new Ereg(createEregModel(orgnr, enhetstype, null, new GruppeModel(null, gruppe.getKode(), gruppe.getBeskrivelse())), new ArrayList<>()); + } + + private Ereg createEreg(String orgnr, String enhetstype) { + return new Ereg(createEregModel(orgnr, enhetstype), new ArrayList<>()); + } + @Test @DirtiesContext(methodMode = DirtiesContext.MethodMode.BEFORE_METHOD) void should_not_have_arbeidsforhold() throws Exception { @@ -77,7 +128,6 @@ void should_not_have_arbeidsforhold() throws Exception { assertThat(response.getListe().get(1).isKanHaArbeidsforhold()).isFalse(); } - @Test @DirtiesContext(methodMode = DirtiesContext.MethodMode.BEFORE_METHOD) void should_have_arbeidsforhold() throws Exception { @@ -125,7 +175,6 @@ void should_only_get_EREGS() throws Exception { ); } - @Test @DirtiesContext(methodMode = DirtiesContext.MethodMode.BEFORE_METHOD) void shouldGetEregsWithOpprinnelse() throws Exception { @@ -184,7 +233,6 @@ void shouldGetEregWithGruppe() throws Exception { assertThat(response.getListe()).containsOnly(new Ereg(eregModel, new ArrayList<>())); } - @Test @DirtiesContext(methodMode = DirtiesContext.MethodMode.BEFORE_METHOD) void shouldOnlyGetEregWithGruppe() throws Exception { @@ -235,7 +283,6 @@ void shouldAddEregWithGruppe() throws Exception { .isEqualTo(gruppeModel); } - @Test @DirtiesContext(methodMode = DirtiesContext.MethodMode.BEFORE_METHOD) void shouldAddOpprinnelseToDatabase() throws Exception { @@ -253,50 +300,4 @@ void shouldAddOpprinnelseToDatabase() throws Exception { .comparingOnlyFields("navn") .isEqualTo(new OpprinnelseModel(altinn)); } - - - private EregListe create(Ereg... eregs) { - return new EregListe(Arrays.asList(eregs)); - } - - @AfterEach - public void cleanUp() { - eregRepository.deleteAll(); - gruppeRepository.deleteAll(); - opprinnelseRepository.deleteAll(); - } - - - private EregModel createEregModel(String orgnr, String enhetstype, GruppeModel gruppeModel) { - return createEregModel(orgnr, enhetstype, null, gruppeModel); - } - - private EregModel createEregModel(String orgnr, String enhetstype, OpprinnelseModel opprinnelseModel) { - return createEregModel(orgnr, enhetstype, opprinnelseModel, null); - } - - private EregModel createEregModel(String orgnr, String enhetstype, OpprinnelseModel opprinnelseModel, GruppeModel gruppeModel) { - EregModel model = new EregModel(); - model.setOrgnr(orgnr); - model.setEnhetstype(enhetstype); - model.setOpprinnelseModel(opprinnelseModel); - model.setGruppeModel(gruppeModel); - return model; - } - - private EregModel createEregModel(String orgnr, String enhetstype) { - return createEregModel(orgnr, enhetstype, null, null); - } - - private Ereg createEreg(String orgnr, String enhetstype, String opprinnelse) { - return new Ereg(createEregModel(orgnr, enhetstype, new OpprinnelseModel(opprinnelse)), new ArrayList<>()); - } - - private Ereg createEreg(String orgnr, String enhetstype, Gruppe gruppe) { - return new Ereg(createEregModel(orgnr, enhetstype, null, new GruppeModel(null, gruppe.getKode(), gruppe.getBeskrivelse())), new ArrayList<>()); - } - - private Ereg createEreg(String orgnr, String enhetstype) { - return new Ereg(createEregModel(orgnr, enhetstype), new ArrayList<>()); - } } diff --git a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1KrrIntegrationTest.java b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1KrrIntegrationTest.java index a16c0c98b38..dc480ccad39 100644 --- a/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1KrrIntegrationTest.java +++ b/apps/testnorge-statisk-data-forvalter/src/test/java/no/nav/registre/sdforvalter/provider/rs/v1/StaticDataControllerV1KrrIntegrationTest.java @@ -1,6 +1,7 @@ package no.nav.registre.sdforvalter.provider.rs.v1; import com.fasterxml.jackson.databind.ObjectMapper; +import no.nav.registre.sdforvalter.JwtDecoderConfig; import no.nav.registre.sdforvalter.database.model.GruppeModel; import no.nav.registre.sdforvalter.database.model.KrrModel; import no.nav.registre.sdforvalter.database.repository.KrrRepository; @@ -8,12 +9,15 @@ import no.nav.registre.sdforvalter.domain.KrrListe; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; 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.cloud.contract.wiremock.AutoConfigureWireMock; +import org.springframework.context.annotation.Import; import org.springframework.http.MediaType; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; import java.util.Arrays; @@ -27,12 +31,13 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest( - webEnvironment = RANDOM_PORT, - properties = "spring.cloud.vault.token=SET_TO_SOMETHING_TO_ALLOW_CONTEXT_TO_LOAD" + webEnvironment = RANDOM_PORT ) +@ExtendWith(SpringExtension.class) @ActiveProfiles("test") +@AutoConfigureMockMvc() @AutoConfigureWireMock(port = 0) -@AutoConfigureMockMvc +@Import(JwtDecoderConfig.class) class StaticDataControllerV1KrrIntegrationTest { @Autowired private MockMvc mvc; @@ -43,6 +48,39 @@ class StaticDataControllerV1KrrIntegrationTest { @Autowired private KrrRepository repository; + @AfterEach + public void cleanUp() { + reset(); + repository.deleteAll(); + } + + private KrrModel createKrrModel(String fnr) { + return createKrrModel(fnr, null); + } + + private KrrModel createKrrModel(String fnr, String gruppe) { + KrrModel model = new KrrModel(); + model.setFnr(fnr); + model.setGruppeModel(gruppe != null ? createGruppeModel(gruppe) : null); + return model; + } + + private GruppeModel createGruppeModel(String gruppe) { + return new GruppeModel(null, gruppe, null); + } + + private KrrListe createKrrListe(Krr... krrs) { + return new KrrListe(Arrays.asList(krrs)); + } + + private Krr createKrr(String fnr) { + return new Krr(createKrrModel(fnr)); + } + + private Krr createKrr(String fnr, String gruppe) { + return new Krr(createKrrModel(fnr, gruppe)); + } + @Test void shouldGetKrr() throws Exception { KrrModel model = createKrrModel("0101011236"); @@ -58,7 +96,6 @@ void shouldGetKrr() throws Exception { assertThat(response.getListe()).containsOnly(new Krr(model)); } - @Test void shouldCreateKrr() throws Exception { Krr krr = createKrr("0101011236"); @@ -70,7 +107,6 @@ void shouldCreateKrr() throws Exception { assertThat(repository.findAll()).containsOnly(new KrrModel(krr, null, null)); } - @Test void shouldOnlyGetKrrWithGruppe() throws Exception { Krr krr = createKrr("0101011236"); @@ -85,39 +121,4 @@ void shouldOnlyGetKrrWithGruppe() throws Exception { assertThat(repository.findAll()).containsOnly(new KrrModel(krrGruppeDolly, null, null)); } - private KrrModel createKrrModel(String fnr) { - return createKrrModel(fnr, null); - } - - private KrrModel createKrrModel(String fnr, String gruppe) { - KrrModel model = new KrrModel(); - model.setFnr(fnr); - model.setGruppeModel(gruppe != null ? createGruppeModel(gruppe) : null); - return model; - } - - private GruppeModel createGruppeModel(String gruppe) { - return new GruppeModel(null, gruppe, null); - } - - - private KrrListe createKrrListe(Krr... krrs) { - return new KrrListe(Arrays.asList(krrs)); - } - - private Krr createKrr(String fnr) { - return new Krr(createKrrModel(fnr)); - } - - private Krr createKrr(String fnr, String gruppe) { - return new Krr(createKrrModel(fnr, gruppe)); - } - - - @AfterEach - public void cleanUp() { - reset(); - repository.deleteAll(); - } - } diff --git a/apps/testnorge-statisk-data-forvalter/src/test/resources/application-test.yml b/apps/testnorge-statisk-data-forvalter/src/test/resources/application-test.yml index db527311ba3..7d3ddbd02e5 100644 --- a/apps/testnorge-statisk-data-forvalter/src/test/resources/application-test.yml +++ b/apps/testnorge-statisk-data-forvalter/src/test/resources/application-test.yml @@ -1,3 +1,5 @@ +AAD_ISSUER_URI: http://localhost:${wiremock.server.port:0}/token + spring: datasource: url: jdbc:h2:mem:testdb @@ -18,7 +20,6 @@ spring: vault: enabled: false -AAD_ISSUER_URI: http://localhost:${wiremock.server.port:0}/token consumers: generer-navn-service: diff --git a/apps/tilbakemelding-api/src/test/java/no/nav/registre/testnorge/tilbakemeldingapi/ApplicationContextTest.java b/apps/tilbakemelding-api/src/test/java/no/nav/registre/testnorge/tilbakemeldingapi/ApplicationContextTest.java index e4e96cffc49..2df108474de 100644 --- a/apps/tilbakemelding-api/src/test/java/no/nav/registre/testnorge/tilbakemeldingapi/ApplicationContextTest.java +++ b/apps/tilbakemelding-api/src/test/java/no/nav/registre/testnorge/tilbakemeldingapi/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private JwtDecoder jwtDecoder; diff --git a/apps/tps-messaging-service/src/test/java/no/nav/testnav/apps/tpsmessagingservice/ApplicationContextTest.java b/apps/tps-messaging-service/src/test/java/no/nav/testnav/apps/tpsmessagingservice/ApplicationContextTest.java index 90ed768d9e0..a3075b407ba 100644 --- a/apps/tps-messaging-service/src/test/java/no/nav/testnav/apps/tpsmessagingservice/ApplicationContextTest.java +++ b/apps/tps-messaging-service/src/test/java/no/nav/testnav/apps/tpsmessagingservice/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private JwtDecoder jwtDecoder; diff --git a/apps/udi-stub/build.gradle b/apps/udi-stub/build.gradle index 34832bd733e..2485bf71e9c 100644 --- a/apps/udi-stub/build.gradle +++ b/apps/udi-stub/build.gradle @@ -21,7 +21,7 @@ configurations { } dependencies { - implementation platform("org.testcontainers:testcontainers-bom:1.19.8") + implementation platform("org.testcontainers:testcontainers-bom:1.20.4") implementation "com.sun.xml.ws:jaxws-rt:$versions.jaxws" @@ -54,6 +54,6 @@ dependencies { testImplementation "org.testcontainers:postgresql" testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" //TODO upgrade to JUnit5 - testImplementation "org.mockito:mockito-junit-jupiter:5.12.0" + testImplementation "org.mockito:mockito-junit-jupiter:5.15.2" } diff --git a/apps/udi-stub/src/test/java/no/nav/udistub/converter/itest/UdiStubITest.java b/apps/udi-stub/src/test/java/no/nav/udistub/converter/itest/UdiStubITest.java index 54170daf2a5..6395b61afee 100644 --- a/apps/udi-stub/src/test/java/no/nav/udistub/converter/itest/UdiStubITest.java +++ b/apps/udi-stub/src/test/java/no/nav/udistub/converter/itest/UdiStubITest.java @@ -10,7 +10,7 @@ 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.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.core.io.ClassPathResource; import org.springframework.http.MediaType; @@ -54,7 +54,7 @@ class UdiStubITest { protected static final UdiPerson TESTPERSON_UDI = createPersonTo(); - @MockBean + @MockitoBean @SuppressWarnings("unused") private JwtDecoder jwtDecoder; @Autowired @@ -63,7 +63,7 @@ class UdiStubITest { private MapperFacade mapperFacade; @Autowired private MockMvc mockMvc; - @MockBean + @MockitoBean private Flyway flyway; @BeforeEach diff --git a/apps/varslinger-service/src/test/java/no/nav/registre/varslingerservice/controller/VarslingerControllerTest.java b/apps/varslinger-service/src/test/java/no/nav/registre/varslingerservice/controller/VarslingerControllerTest.java index 3a823bfb95b..e58a31b5a1b 100644 --- a/apps/varslinger-service/src/test/java/no/nav/registre/varslingerservice/controller/VarslingerControllerTest.java +++ b/apps/varslinger-service/src/test/java/no/nav/registre/varslingerservice/controller/VarslingerControllerTest.java @@ -9,7 +9,7 @@ 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.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.http.MediaType; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -24,7 +24,7 @@ @ActiveProfiles("test") class VarslingerControllerTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; @Autowired diff --git a/apps/varslinger-service/src/test/java/no/nav/registre/varslingerservice/controller/VarslingerPersonControllerTest.java b/apps/varslinger-service/src/test/java/no/nav/registre/varslingerservice/controller/VarslingerPersonControllerTest.java index 67839a20d53..d54e71c2218 100644 --- a/apps/varslinger-service/src/test/java/no/nav/registre/varslingerservice/controller/VarslingerPersonControllerTest.java +++ b/apps/varslinger-service/src/test/java/no/nav/registre/varslingerservice/controller/VarslingerPersonControllerTest.java @@ -17,7 +17,7 @@ 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.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.http.MediaType; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -35,13 +35,13 @@ @ActiveProfiles("test") class VarslingerPersonControllerTest { - @MockBean + @MockitoBean public JwtDecoder jwtDecoder; - @MockBean + @MockitoBean public GetAuthenticatedToken getAuthenticatedToken; - @MockBean + @MockitoBean public GetAuthenticatedId getAuthenticatedId; @Autowired diff --git a/libs/kafka-producers/build.gradle b/libs/kafka-producers/build.gradle index 1f09eb7b21d..af1f6160b0d 100644 --- a/libs/kafka-producers/build.gradle +++ b/libs/kafka-producers/build.gradle @@ -14,7 +14,7 @@ dependencies { implementation 'no.nav.testnav.libs:avro-schema' implementation 'org.springframework.kafka:spring-kafka' - implementation "io.confluent:kafka-avro-serializer:$versions.avro" + implementation "io.confluent:kafka-avro-serializer:$versions.avroSerializer" implementation 'org.springframework.boot:spring-boot-starter-web' } \ No newline at end of file diff --git a/plugins/java/src/main/groovy/dolly-versions.gradle b/plugins/java/src/main/groovy/dolly-versions.gradle index 21ecd0f94d8..869af3ab95b 100644 --- a/plugins/java/src/main/groovy/dolly-versions.gradle +++ b/plugins/java/src/main/groovy/dolly-versions.gradle @@ -4,21 +4,21 @@ class DollyVersionCatalog { String navAltinnInntektsmelding = "1.2019.08.16-13.46-35cbdfd492d4" String navFellesregister = "2020.08.27-09.53-183ead3d81eb" - String springBoot = "3.3.2" - String springSession = "3.3.1" - String springCloud = "2023.0.3" + String springBoot = "3.4.1" + String springSession = "3.4.1" + String springCloud = "2024.0.0" - String gcpSecretManager = "5.7.0" + String gcpSecretManager = "5.9.0" - String apacheAvro = "1.11.3" - String apacheKafka = "3.7.0" + String apacheAvro = "1.12.0" + String apacheKafka = "3.9.0" String apachePoi = "5.3.0" - String assertj = "3.26.0" - String avro = "7.6.1" - String bouncyCastle = "1.78.1" - String guava = "33.2.0-jre" - String grpc = "1.68.1" - String jackson = "2.17.2" + String assertj = "3.27.2" + String avroSerializer = "7.8.0" + String bouncyCastle = "1.79" + String guava = "33.4.0-jre" + String grpc = "1.69.0" + String jackson = "2.18.2" String jakartaActivation = "2.1.3" String jakartaValidation = "3.1.0" String jakartaXmlBindApi = "4.0.2" @@ -26,15 +26,15 @@ class DollyVersionCatalog { String javaxAnnotation = "1.3.2" String jaxb = "4.0.5" String jaxws = "4.0.2" - String jweaver = "1.9.22" + String jweaver = "1.9.22.1" String jwt = "4.4.0" String logback = "8.0" - String mq = "3.2.3" - String okhttp = "4.10.0" + String mq = "3.3.5" + String okhttp = "4.12.0" String opensearch = "1.5.1" String orika = "1.5.4" String reactorSpring = "1.0.1.RELEASE" - String reactorTest = "3.6.8" - String springdoc = "2.5.0" - String swagger = "2.2.22" + String reactorTest = "3.7.1" + String springdoc = "2.8.0" + String swagger = "2.2.27" } \ No newline at end of file diff --git a/proxies/aareg-proxy/src/test/java/no/nav/testnav/proxies/aareg/ApplicationContextTest.java b/proxies/aareg-proxy/src/test/java/no/nav/testnav/proxies/aareg/ApplicationContextTest.java index 6818a8cfb6c..655310425bc 100644 --- a/proxies/aareg-proxy/src/test/java/no/nav/testnav/proxies/aareg/ApplicationContextTest.java +++ b/proxies/aareg-proxy/src/test/java/no/nav/testnav/proxies/aareg/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder jwtDecoder; diff --git a/proxies/aareg-synt-services-proxy/src/test/java/no/nav/testnav/proxies/aaregsyntservicesproxy/ApplicationContextTest.java b/proxies/aareg-synt-services-proxy/src/test/java/no/nav/testnav/proxies/aaregsyntservicesproxy/ApplicationContextTest.java index 382af6d0294..4b47212cd5c 100644 --- a/proxies/aareg-synt-services-proxy/src/test/java/no/nav/testnav/proxies/aaregsyntservicesproxy/ApplicationContextTest.java +++ b/proxies/aareg-synt-services-proxy/src/test/java/no/nav/testnav/proxies/aaregsyntservicesproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/altinn3-tilgang-proxy/src/test/java/no/nav/testnav/altinn3tilgangproxy/ApplicationContextTest.java b/proxies/altinn3-tilgang-proxy/src/test/java/no/nav/testnav/altinn3tilgangproxy/ApplicationContextTest.java index e630af4e0f0..cd99a39a82a 100644 --- a/proxies/altinn3-tilgang-proxy/src/test/java/no/nav/testnav/altinn3tilgangproxy/ApplicationContextTest.java +++ b/proxies/altinn3-tilgang-proxy/src/test/java/no/nav/testnav/altinn3tilgangproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private JwtDecoder jwtDecoder; diff --git a/proxies/arbeidsplassencv-proxy/src/test/java/no/nav/testnav/proxies/arbeidsplassencvproxy/ApplicationContextTest.java b/proxies/arbeidsplassencv-proxy/src/test/java/no/nav/testnav/proxies/arbeidsplassencvproxy/ApplicationContextTest.java index 96dd71fced3..b0cdf10b87e 100644 --- a/proxies/arbeidsplassencv-proxy/src/test/java/no/nav/testnav/proxies/arbeidsplassencvproxy/ApplicationContextTest.java +++ b/proxies/arbeidsplassencv-proxy/src/test/java/no/nav/testnav/proxies/arbeidsplassencvproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/arena-forvalteren-proxy/src/test/java/no/nav/testnav/proxies/arenaforvalterenproxy/ApplicationContextTest.java b/proxies/arena-forvalteren-proxy/src/test/java/no/nav/testnav/proxies/arenaforvalterenproxy/ApplicationContextTest.java index 81082b6907b..af0e75459b6 100644 --- a/proxies/arena-forvalteren-proxy/src/test/java/no/nav/testnav/proxies/arenaforvalterenproxy/ApplicationContextTest.java +++ b/proxies/arena-forvalteren-proxy/src/test/java/no/nav/testnav/proxies/arenaforvalterenproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/batch-adeo-proxy/src/test/java/no/nav/testnav/proxies/batchadeoproxy/ApplicationContextTest.java b/proxies/batch-adeo-proxy/src/test/java/no/nav/testnav/proxies/batchadeoproxy/ApplicationContextTest.java index adb79f69ca5..472bc790304 100644 --- a/proxies/batch-adeo-proxy/src/test/java/no/nav/testnav/proxies/batchadeoproxy/ApplicationContextTest.java +++ b/proxies/batch-adeo-proxy/src/test/java/no/nav/testnav/proxies/batchadeoproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/brregstub-proxy/src/test/java/no/nav/testnav/proxies/brregstubproxy/ApplicationContextTest.java b/proxies/brregstub-proxy/src/test/java/no/nav/testnav/proxies/brregstubproxy/ApplicationContextTest.java index 7aa3e0f575d..d9d79ec3172 100644 --- a/proxies/brregstub-proxy/src/test/java/no/nav/testnav/proxies/brregstubproxy/ApplicationContextTest.java +++ b/proxies/brregstub-proxy/src/test/java/no/nav/testnav/proxies/brregstubproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/dokarkiv-proxy/src/test/java/no/nav/testnav/proxies/dokarkivproxy/ApplicationContextTest.java b/proxies/dokarkiv-proxy/src/test/java/no/nav/testnav/proxies/dokarkivproxy/ApplicationContextTest.java index ca878ee5c89..62da1e8f022 100644 --- a/proxies/dokarkiv-proxy/src/test/java/no/nav/testnav/proxies/dokarkivproxy/ApplicationContextTest.java +++ b/proxies/dokarkiv-proxy/src/test/java/no/nav/testnav/proxies/dokarkivproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") public ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/ereg-proxy/src/test/java/no/nav/testnav/proxies/eregproxy/ApplicationContextTest.java b/proxies/ereg-proxy/src/test/java/no/nav/testnav/proxies/eregproxy/ApplicationContextTest.java index b4238b59ebf..9b2484e75cf 100644 --- a/proxies/ereg-proxy/src/test/java/no/nav/testnav/proxies/eregproxy/ApplicationContextTest.java +++ b/proxies/ereg-proxy/src/test/java/no/nav/testnav/proxies/eregproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/fullmakt-proxy/src/test/java/no/nav/testnav/proxies/fullmaktproxy/ApplicationContextTest.java b/proxies/fullmakt-proxy/src/test/java/no/nav/testnav/proxies/fullmaktproxy/ApplicationContextTest.java index 9e39e82faac..04a78f9afcb 100644 --- a/proxies/fullmakt-proxy/src/test/java/no/nav/testnav/proxies/fullmaktproxy/ApplicationContextTest.java +++ b/proxies/fullmakt-proxy/src/test/java/no/nav/testnav/proxies/fullmaktproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/histark-proxy/src/test/java/no/nav/testnav/proxies/histarkproxy/ApplicationContextTest.java b/proxies/histark-proxy/src/test/java/no/nav/testnav/proxies/histarkproxy/ApplicationContextTest.java index c8263cb22d3..850d12e1cb0 100644 --- a/proxies/histark-proxy/src/test/java/no/nav/testnav/proxies/histarkproxy/ApplicationContextTest.java +++ b/proxies/histark-proxy/src/test/java/no/nav/testnav/proxies/histarkproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/inntektstub-proxy/src/test/java/no/nav/testnav/proxies/inntektstubproxy/ApplicationContextTest.java b/proxies/inntektstub-proxy/src/test/java/no/nav/testnav/proxies/inntektstubproxy/ApplicationContextTest.java index 9409541e8e2..5e9abe6f395 100644 --- a/proxies/inntektstub-proxy/src/test/java/no/nav/testnav/proxies/inntektstubproxy/ApplicationContextTest.java +++ b/proxies/inntektstub-proxy/src/test/java/no/nav/testnav/proxies/inntektstubproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/inst-proxy/src/test/java/no/nav/testnav/proxies/instproxy/ApplicationContextTest.java b/proxies/inst-proxy/src/test/java/no/nav/testnav/proxies/instproxy/ApplicationContextTest.java index 2fc7061fa85..d9871da5c72 100644 --- a/proxies/inst-proxy/src/test/java/no/nav/testnav/proxies/instproxy/ApplicationContextTest.java +++ b/proxies/inst-proxy/src/test/java/no/nav/testnav/proxies/instproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/kontoregister-person-proxy/src/test/java/no/nav/testnav/proxies/kontoregisterperson/ApplicationContextTest.java b/proxies/kontoregister-person-proxy/src/test/java/no/nav/testnav/proxies/kontoregisterperson/ApplicationContextTest.java index 0480187bda0..8f45a8da10e 100644 --- a/proxies/kontoregister-person-proxy/src/test/java/no/nav/testnav/proxies/kontoregisterperson/ApplicationContextTest.java +++ b/proxies/kontoregister-person-proxy/src/test/java/no/nav/testnav/proxies/kontoregisterperson/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/krrstub-proxy/src/test/java/no/nav/testnav/proxies/krrstubproxy/ApplicationContextTest.java b/proxies/krrstub-proxy/src/test/java/no/nav/testnav/proxies/krrstubproxy/ApplicationContextTest.java index ad0124eba2b..9bc1d71da6b 100644 --- a/proxies/krrstub-proxy/src/test/java/no/nav/testnav/proxies/krrstubproxy/ApplicationContextTest.java +++ b/proxies/krrstub-proxy/src/test/java/no/nav/testnav/proxies/krrstubproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/medl-proxy/src/test/java/no/nav/testnav/proxies/medlproxy/ApplicationContextTest.java b/proxies/medl-proxy/src/test/java/no/nav/testnav/proxies/medlproxy/ApplicationContextTest.java index 82e8113faaa..0b00d93fba0 100644 --- a/proxies/medl-proxy/src/test/java/no/nav/testnav/proxies/medlproxy/ApplicationContextTest.java +++ b/proxies/medl-proxy/src/test/java/no/nav/testnav/proxies/medlproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/norg2-proxy/src/test/java/no/nav/testnav/proxies/norg2proxy/ApplicationContextTest.java b/proxies/norg2-proxy/src/test/java/no/nav/testnav/proxies/norg2proxy/ApplicationContextTest.java index 7a125b93143..f353c683605 100644 --- a/proxies/norg2-proxy/src/test/java/no/nav/testnav/proxies/norg2proxy/ApplicationContextTest.java +++ b/proxies/norg2-proxy/src/test/java/no/nav/testnav/proxies/norg2proxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/pdl-proxy/src/test/java/no/nav/testnav/proxies/pdlproxy/ApplicationContextTest.java b/proxies/pdl-proxy/src/test/java/no/nav/testnav/proxies/pdlproxy/ApplicationContextTest.java index 105c63bc51e..a663dce9d0c 100644 --- a/proxies/pdl-proxy/src/test/java/no/nav/testnav/proxies/pdlproxy/ApplicationContextTest.java +++ b/proxies/pdl-proxy/src/test/java/no/nav/testnav/proxies/pdlproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder jwtDecoder; diff --git a/proxies/pensjon-testdata-facade-proxy/src/test/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/ApplicationContextTest.java b/proxies/pensjon-testdata-facade-proxy/src/test/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/ApplicationContextTest.java index eab4ba77905..cc34dfdc4f5 100644 --- a/proxies/pensjon-testdata-facade-proxy/src/test/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/ApplicationContextTest.java +++ b/proxies/pensjon-testdata-facade-proxy/src/test/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/saf-proxy/src/test/java/no/nav/testnav/proxies/safproxy/ApplicationContextTest.java b/proxies/saf-proxy/src/test/java/no/nav/testnav/proxies/safproxy/ApplicationContextTest.java index 410a0ab0c4e..be043fe17a1 100644 --- a/proxies/saf-proxy/src/test/java/no/nav/testnav/proxies/safproxy/ApplicationContextTest.java +++ b/proxies/saf-proxy/src/test/java/no/nav/testnav/proxies/safproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") public ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/sigrunstub-proxy/src/test/java/no/nav/testnav/proxies/sigrunstubproxy/ApplicationContextTest.java b/proxies/sigrunstub-proxy/src/test/java/no/nav/testnav/proxies/sigrunstubproxy/ApplicationContextTest.java index 47bf9ceff2e..60ff12b93b8 100644 --- a/proxies/sigrunstub-proxy/src/test/java/no/nav/testnav/proxies/sigrunstubproxy/ApplicationContextTest.java +++ b/proxies/sigrunstub-proxy/src/test/java/no/nav/testnav/proxies/sigrunstubproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/synthdata-meldekort-proxy/src/test/java/no/nav/testnav/proxies/synthdatameldekortproxy/ApplicationContextTest.java b/proxies/synthdata-meldekort-proxy/src/test/java/no/nav/testnav/proxies/synthdatameldekortproxy/ApplicationContextTest.java index 2c897ad945b..368381d8b52 100644 --- a/proxies/synthdata-meldekort-proxy/src/test/java/no/nav/testnav/proxies/synthdatameldekortproxy/ApplicationContextTest.java +++ b/proxies/synthdata-meldekort-proxy/src/test/java/no/nav/testnav/proxies/synthdatameldekortproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/udistub-proxy/src/test/java/no/nav/testnav/proxies/udistubproxy/ApplicationContextTest.java b/proxies/udistub-proxy/src/test/java/no/nav/testnav/proxies/udistubproxy/ApplicationContextTest.java index 48f8ffb9897..c4e83fa3778 100644 --- a/proxies/udistub-proxy/src/test/java/no/nav/testnav/proxies/udistubproxy/ApplicationContextTest.java +++ b/proxies/udistub-proxy/src/test/java/no/nav/testnav/proxies/udistubproxy/ApplicationContextTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean @SuppressWarnings("unused") private ReactiveJwtDecoder reactiveJwtDecoder; diff --git a/proxies/yrkesskade-proxy/src/test/java/no/nav/testnav/proxies/yrkesskadeproxy/ApplicationContextTest.java b/proxies/yrkesskade-proxy/src/test/java/no/nav/testnav/proxies/yrkesskadeproxy/ApplicationContextTest.java index 3f79811d2c2..bb52dc30edb 100644 --- a/proxies/yrkesskade-proxy/src/test/java/no/nav/testnav/proxies/yrkesskadeproxy/ApplicationContextTest.java +++ b/proxies/yrkesskade-proxy/src/test/java/no/nav/testnav/proxies/yrkesskadeproxy/ApplicationContextTest.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.test.context.ActiveProfiles; @@ -12,7 +12,7 @@ @ActiveProfiles("test") class ApplicationContextTest { - @MockBean + @MockitoBean private ReactiveJwtDecoder jwtDecoder; @Test