Skip to content

Commit

Permalink
T - Legger til test-konfigurasjon for gjenny endepunkt
Browse files Browse the repository at this point in the history
  • Loading branch information
dskarpas committed Sep 12, 2024
1 parent e02e2a5 commit a88d1d9
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ class IntegrasjonsTestConfig {
@Bean
fun navansattRestTemplate(): RestTemplate = mockedRestTemplate()

@Bean
fun etterlatteRestTemplate(): RestTemplate = mockedRestTemplate()

@Bean
fun gcpStorageService(): GcpStorageService = mockk()

Expand Down
18 changes: 10 additions & 8 deletions src/test/resources/application-integrationtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 7 additions & 3 deletions src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a88d1d9

Please sign in to comment.