Skip to content

Commit

Permalink
Spring oppdatering for diverse apper, refaktorering vekk fra deprecat…
Browse files Browse the repository at this point in the history
…ed funksjonalitet og skrevet om noen tester

#deploy-udi-stub
#deploy-tenor-search-service
#deploy-miljoer-service
#deploy-kodeverk-service
  • Loading branch information
stigus committed Jan 8, 2025
1 parent 922de4c commit 093092b
Show file tree
Hide file tree
Showing 74 changed files with 311 additions and 298 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -13,7 +13,7 @@
@ActiveProfiles("test")
public class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -14,7 +14,7 @@
@ActiveProfiles("test")
class LevendeArbeidsforholdAnsettelseApplicationTests {

@MockBean
@MockitoBean
@SuppressWarnings("unused")
public ReactiveJwtDecoder jwtDecoder;

Expand Down
2 changes: 1 addition & 1 deletion apps/levende-arbeidsforhold-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;

@ActiveProfiles("test")
@SpringBootTest
public class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
2 changes: 1 addition & 1 deletion apps/organisasjon-faste-data-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
private JwtDecoder jwtDecoder;

@Test
Expand Down
2 changes: 1 addition & 1 deletion apps/organisasjon-mottak-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -13,7 +13,7 @@
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
@SuppressWarnings("unused")
private JwtDecoder jwtDecoder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,7 +17,7 @@
@TestPropertySource(locations = "classpath:application-test.yml")
public class ApplicationContextTest {

@MockBean
@MockitoBean
@SuppressWarnings("unused")
private JwtDecoder jwtDecoder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
public ReactiveJwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;

@SpringBootTest
@ActiveProfiles("test")
class ApplicationContextTest {

@MockBean
@MockitoBean
public JwtDecoder jwtDecoder;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,10 +36,10 @@
@AutoConfigureWireMock(port = 0)
public class ArbeidsforholdConsumerTest {

@MockBean
@MockitoBean
private JwtDecoder jwtDecoder;

@MockBean
@MockitoBean
private TokenExchange tokenService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,10 +36,10 @@
@AutoConfigureWireMock(port = 0)
public class HelsepersonellConsumerTest {

@MockBean
@MockitoBean
private JwtDecoder jwtDecoder;

@MockBean
@MockitoBean
private TokenExchange tokenService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,10 +36,10 @@
@AutoConfigureWireMock(port = 0)
public class OrganisasjonConsumerTest {

@MockBean
@MockitoBean
private JwtDecoder jwtDecoder;

@MockBean
@MockitoBean
private TokenExchange tokenService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,10 +36,10 @@
@AutoConfigureWireMock(port = 0)
public class PdlProxyConsumerTest {

@MockBean
@MockitoBean
private JwtDecoder jwtDecoder;

@MockBean
@MockitoBean
private TokenExchange tokenService;

@Autowired
Expand Down
Loading

0 comments on commit 093092b

Please sign in to comment.