diff --git a/apps/kodeverk-service/config.yml b/apps/kodeverk-service/config.yml index 4be570ad76c..f1bedff64d4 100644 --- a/apps/kodeverk-service/config.yml +++ b/apps/kodeverk-service/config.yml @@ -22,6 +22,7 @@ spec: - application: testnav-pdl-forvalter - application: testnav-pdl-forvalter-dev - application: testnav-levende-arbeidsforhold-ansettelse + - application: testnorge-statisk-data-forvalter outbound: external: - host: kodeverk-api.nav.no diff --git a/apps/testnorge-statisk-data-forvalter/config.yml b/apps/testnorge-statisk-data-forvalter/config.yml index 40443d77705..f88cc237a50 100644 --- a/apps/testnorge-statisk-data-forvalter/config.yml +++ b/apps/testnorge-statisk-data-forvalter/config.yml @@ -71,6 +71,7 @@ spec: - application: krr-stub - application: synthdata-aareg cluster: dev-fss - - application: kodeverk + - application: testnav-kodeverk-service + cluster: dev-gcp - application: testnav-aareg-proxy cluster: dev-fss diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/Consumers.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/Consumers.java index ce2fe92f9c1..c8b8b253faa 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/Consumers.java +++ b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/Consumers.java @@ -26,7 +26,7 @@ public class Consumers { private ServerProperties testnavAaregProxy; private ServerProperties genererNavnService; - private ServerProperties kodeverkApi; + private ServerProperties testnavKodeverkService; private ServerProperties testnavOrganisasjonFasteDataService; private ServerProperties testnavOrganisasjonService; private ServerProperties testnavPersonFasteDataService; diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/kodeverk/KodeverkConsumer.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/kodeverk/KodeverkConsumer.java index a26bc753f5b..d6a8a1540df 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/kodeverk/KodeverkConsumer.java +++ b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/kodeverk/KodeverkConsumer.java @@ -23,7 +23,7 @@ public KodeverkConsumer( .maxInMemorySize(16 * 1024 * 1024)) .build()) .baseUrl(consumers - .getKodeverkApi() + .getTestnavKodeverkService() .getUrl()) .build(); } diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/krr/KrrConsumer.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/krr/KrrConsumer.java index db10b87c9c5..90dda96b35d 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/krr/KrrConsumer.java +++ b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/krr/KrrConsumer.java @@ -6,7 +6,11 @@ import no.nav.registre.sdforvalter.domain.KrrListe; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.*; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.RequestEntity; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RestTemplate; diff --git a/apps/testnorge-statisk-data-forvalter/src/main/resources/application-local.yml b/apps/testnorge-statisk-data-forvalter/src/main/resources/application-local.yml index 5ca60787a43..29eabc600d3 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/resources/application-local.yml +++ b/apps/testnorge-statisk-data-forvalter/src/main/resources/application-local.yml @@ -25,3 +25,6 @@ consumers: url: https://testnav-bruker-service-dev.intern.dev.nav.no synthdata-aareg: url: https://nais-synthdata-aareg.dev.intern.nav.no + testnav-kodeverk-service: + url: https://testnav-kodeverk-service.intern.dev.nav.no + diff --git a/apps/testnorge-statisk-data-forvalter/src/main/resources/application.yml b/apps/testnorge-statisk-data-forvalter/src/main/resources/application.yml index e5589722506..fb9d79b9227 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/resources/application.yml +++ b/apps/testnorge-statisk-data-forvalter/src/main/resources/application.yml @@ -16,7 +16,7 @@ spring: aad: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys - accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID} + accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID} springdoc: swagger-ui: @@ -59,11 +59,11 @@ consumers: url: https://krr-stub-%s.dev.intern.nav.no/api synthdata-aareg: url: http://nais-synthdata-aareg.dolly.svc.nais.local - kodeverk-api: - name: kodeverk-api - namespace: team-rocket - url: https://kodeverk-api.nav.no - cluster: prod-gcp + testnav-kodeverk-service: + name: testnav-kodeverk-service + namespace: dolly + url: http://testnav-kodeverk-service.dolly.svc.cluster.local + cluster: dev-gcp testnav-aareg-proxy: name: testnav-aareg-proxy namespace: dolly 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 56670b27755..20631055417 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 @@ -47,33 +47,41 @@ @AutoConfigureMockMvc class OrkestreringControllerAaregIntegrationTest { + private static final String FNR = "01010101010"; + private static final String ORGNR = "999999999"; + private static final String MILJOE = "test"; + private static String syntString; + private final KodeverkResponse kodeverkResponse = new KodeverkResponse(Collections.singletonList("yrke")); + private final TypeReference> syntResponse = new TypeReference<>() { + }; @Autowired private MockMvc mvc; - @MockBean private TokenExchange tokenExchange; - @Autowired private AaregRepository aaregRepository; - @Autowired private ObjectMapper objectMapper; - private static final String FNR = "01010101010"; - private static final String ORGNR = "999999999"; - private static final String MILJOE = "test"; - - private final KodeverkResponse kodeverkResponse = new KodeverkResponse(Collections.singletonList("yrke")); - private static String syntString; - private final TypeReference> syntResponse = new TypeReference<>() { - }; + @AfterEach + public void cleanUp() { + reset(); + aaregRepository.deleteAll(); + } @BeforeAll public static void setup() { syntString = getResourceFileContent("files/enkel_arbeidsforholdmelding.json"); } - @Disabled("Fix verify GET on (.*)/kodeverk-api/api/v1/kodeverk/Yrker/koder") + private AaregModel createAaregModel() { + AaregModel model = new AaregModel(); + model.setFnr(FNR); + model.setOrgId(ORGNR); + return model; + } + + @Disabled("Fix verify GET on (.*)/testnav-kodeverk-service/api/v1/kodeverk/Yrker/koder") @Test void shouldInitiateAaregFromDatabase() throws Exception { final AaregModel aaregModel = createAaregModel(); @@ -127,7 +135,7 @@ void shouldInitiateAaregFromDatabase() throws Exception { JsonWiremockHelper .builder(objectMapper) - .withUrlPathMatching("(.*)/kodeverk-api/api/v1/kodeverk/Yrker/koder") + .withUrlPathMatching("(.*)/testnav-kodeverk-service/api/v1/kodeverk/Yrker/koder") .withResponseBody(kodeverkResponse) .verifyGet(); @@ -167,7 +175,7 @@ void shouldNotOppretteAaregWhenAlreadyExists() throws Exception { } - @Disabled("Fix verify GET on (.*)/kodeverk-api/api/v1/kodeverk/Yrker/koder") + @Disabled("Fix verify GET on (.*)/testnav-kodeverk-service/api/v1/kodeverk/Yrker/koder") @Test void shouldNotOppretteAaregIfSyntError() throws Exception { final AaregModel aaregModel = createAaregModel(); @@ -190,7 +198,7 @@ void shouldNotOppretteAaregIfSyntError() throws Exception { JsonWiremockHelper .builder(objectMapper) - .withUrlPathMatching("(.*)/kodeverk-api/api/v1/kodeverk/Yrker/koder") + .withUrlPathMatching("(.*)/testnav-kodeverk-service/api/v1/kodeverk/Yrker/koder") .withResponseBody(kodeverkResponse) .stubGet(); @@ -213,22 +221,9 @@ void shouldNotOppretteAaregIfSyntError() throws Exception { JsonWiremockHelper .builder(objectMapper) - .withUrlPathMatching("(.*)/kodeverk-api/api/v1/kodeverk/Yrker/koder") + .withUrlPathMatching("(.*)/testnav-kodeverk-service/api/v1/kodeverk/Yrker/koder") .withResponseBody(kodeverkResponse) .verifyGet(); } - private AaregModel createAaregModel() { - AaregModel model = new AaregModel(); - model.setFnr(FNR); - model.setOrgId(ORGNR); - return model; - } - - @AfterEach - public void cleanUp() { - reset(); - aaregRepository.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 a4c5a1d25d2..db527311ba3 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 @@ -46,10 +46,10 @@ consumers: url: http://localhost:${wiremock.server.port:0}/krr-stub/api synthdata-aareg: url: http://localhost:${wiremock.server.port:0}/synt-aareg - kodeverk: - url: http://localhost:${wiremock.server.port:0}/kodeverk-api - name: kodeverk-api - namespace: team-rocket + testnav-kodeverk-service: + url: http://localhost:${wiremock.server.port:0}/testnav-kodeverk-service + name: testnav-kodeverk-service + namespace: dolly cluster: dummy testnav-aareg-proxy: url: http://localhost:${wiremock.server.port:0}/aareg