diff --git a/src/main/kotlin/no/nav/eessi/pensjon/journalforing/etterlatte/EtterlatteService.kt b/src/main/kotlin/no/nav/eessi/pensjon/journalforing/etterlatte/EtterlatteService.kt new file mode 100644 index 000000000..024866a90 --- /dev/null +++ b/src/main/kotlin/no/nav/eessi/pensjon/journalforing/etterlatte/EtterlatteService.kt @@ -0,0 +1,19 @@ +package no.nav.eessi.pensjon.journalforing.etterlatte + +import no.nav.eessi.pensjon.metrics.MetricsHelper +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.stereotype.Component +import org.springframework.stereotype.Service +import org.springframework.web.client.RestTemplate + +@Component +class EtterlatteService( + private val etterlatteRestTemplate: RestTemplate, + @Autowired(required = false) private val metricsHelper: MetricsHelper = MetricsHelper.ForTest() +) { + private lateinit var henterSakFraEtterlatte: MetricsHelper.Metric + + init { + henterSakFraEtterlatte = metricsHelper.init("henterSakFraEtterlatte") + } +} \ No newline at end of file diff --git a/src/test/kotlin/no/nav/eessi/pensjon/integrasjonstest/ConfigRestTemplateTest.kt b/src/test/kotlin/no/nav/eessi/pensjon/integrasjonstest/ConfigRestTemplateTest.kt index f3f6f231b..4f5af9096 100644 --- a/src/test/kotlin/no/nav/eessi/pensjon/integrasjonstest/ConfigRestTemplateTest.kt +++ b/src/test/kotlin/no/nav/eessi/pensjon/integrasjonstest/ConfigRestTemplateTest.kt @@ -59,6 +59,7 @@ import org.springframework.web.client.RestTemplate MockkBean(name = "navansattRestTemplate", classes = [RestTemplate::class]), MockkBean(name = "bestemSakOidcRestTemplate", classes = [RestTemplate::class]), MockkBean(name = "safGraphQlOidcRestTemplate", classes = [RestTemplate::class]), + MockkBean(name = "etterlatteRestTemplate", classes = [RestTemplate::class]), ) internal class ConfigRestTemplateTest { diff --git a/src/test/kotlin/no/nav/eessi/pensjon/integrasjonstest/IntegrasjonsTestConfig.kt b/src/test/kotlin/no/nav/eessi/pensjon/integrasjonstest/IntegrasjonsTestConfig.kt index e662196c3..66ee0793b 100644 --- a/src/test/kotlin/no/nav/eessi/pensjon/integrasjonstest/IntegrasjonsTestConfig.kt +++ b/src/test/kotlin/no/nav/eessi/pensjon/integrasjonstest/IntegrasjonsTestConfig.kt @@ -93,6 +93,9 @@ class IntegrasjonsTestConfig { @Bean fun navansattRestTemplate(): RestTemplate = mockedRestTemplate() + @Bean + fun etterlatteRestTemplate(): RestTemplate = mockedRestTemplate() + @Bean fun gcpStorageService(): GcpStorageService = mockk() diff --git a/src/test/resources/application-integrationtest.yml b/src/test/resources/application-integrationtest.yml index 0ceb23e42..911521b69 100644 --- a/src/test/resources/application-integrationtest.yml +++ b/src/test/resources/application-integrationtest.yml @@ -40,20 +40,22 @@ securityTokenService: NAIS_APP_NAME: eessi-pensjon-journalforing -EUX_RINA_API_V1_URL: http://localhost:${mockServerport} -NAVANSATT_URL: http://localhost:${mockServerport} PDL_URL: http://localhost:${mockServerport} +NORG2_URL: http://localhost:${mockServerport} +BestemSak_URL: http://localhost:${mockServerport} +NAVANSATT_URL: http://localhost:${mockServerport} +ETTERLATTE_URL: http://localhost:${mockServerport} +JOURNALPOST_V1_URL: http://localhost:${mockServerport} +EUX_RINA_API_V1_URL: http://localhost:${mockServerport} +oppgave.oppgaver.url: http://localhost:${mockServerport} +aktoerregister.api.v1.url: http://localhost:${mockServerport} +EESSI_PENSJON_FAGMODUL_URL: http://localhost:${mockServerport} + securitytokenservice.url: http://someurl srvusername: someuser srvpassword: somepass -oppgave.oppgaver.url: http://localhost:${mockServerport} -JOURNALPOST_V1_URL: http://localhost:${mockServerport} -aktoerregister.api.v1.url: http://localhost:${mockServerport} virksomhet.person.v3: endpointurl: http://localhost:${mockServerport} -EESSI_PENSJON_FAGMODUL_URL: http://localhost:${mockServerport} -NORG2_URL: http://localhost:${mockServerport} -BestemSak_URL: http://localhost:${mockServerport} spring: kafka: diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 432f094a8..c71c14e74 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -41,11 +41,15 @@ kafka: security.protocol: SSL METRICS_REQUESTFILTER_ENABLE: false -NAIS_APP_NAME: eessi-pensjon-journalforing + +#REST TEMPLATE URLS +PDL_URL: http://localhost +NAVANSATT_URL: http://localhost SAF_GRAPHQL_URL: http://localhost EUX_RINA_API_V1_URL: http://localhost -NAVANSATT_URL: http://localhost -PDL_URL: http://localhost +NAIS_APP_NAME: eessi-pensjon-journalforing +ETTERLATTE_URL: http://localhost:${mockServerport} + securitytokenservice.url: http://someurl srvusername: someuser srvpassword: somepass