From 956bb0edcd4f3054534cf1574e9d5ccfe7d5ea1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristen=20H=C3=A6rum?= Date: Thu, 26 Sep 2024 15:20:35 +0200 Subject: [PATCH] Refactor to use WebClient.Builder in consumers (#3638) Updated the constructors of various consumer classes to accept and use WebClient.Builder for creating WebClient instances. This improves consistency across the codebase and allows easier customization of WebClient configurations. --- .../consumer/PdlAdresseConsumer.java | 7 ++++--- .../consumer/OppsummeringsdokumentConsumer.java | 7 ++++--- .../consumer/GithubConsumer.java | 7 ++++--- .../consumer/AaregConsumer.java | 7 ++++--- .../PersonOrganisasjonTilgangConsumer.java | 6 +++--- .../PensjonforvalterClient.java | 2 ++ .../nav/dolly/web/consumers/BrukerConsumer.java | 6 +++--- .../PersonOrganisasjonTilgangConsumer.java | 8 ++++---- .../web/consumers/TilbakemeldingConsumer.java | 5 +++-- .../consumer/AdresseServiceConsumer.java | 7 ++++--- .../consumer/GenererNavnServiceConsumer.java | 7 ++++--- .../consumer/IdentPoolConsumer.java | 7 ++++--- .../consumer/TpsMessagingConsumer.java | 6 +++--- .../GenererOrganisasjonPopulasjonConsumer.java | 6 +++--- .../consumer/OppsummeringsdokumentConsumer.java | 6 +++--- .../consumer/OrganisasjonConsumer.java | 6 +++--- .../consumer/SyntArbeidsforholdConsumer.java | 6 +++--- .../consumer/GenererNavnConsumer.java | 7 ++++--- .../consumer/OrgnummerConsumer.java | 7 ++++--- .../consumer/SyntAmeldingConsumer.java | 7 ++++--- .../consumer/DokmotConsumer.java | 7 ++++--- .../GenererInntektsmeldingConsumer.java | 8 ++++---- .../consumer/JenkinsConsumer.java | 7 ++++--- .../OrganisasjonBestillingConsumer.java | 7 ++++--- .../consumer/SafConsumer.java | 7 ++++--- .../consumers/AaregConsumer.java | 6 +++--- .../consumers/KodeverkServiceConsumer.java | 6 +++--- .../consumers/TenorConsumer.java | 6 +++--- .../consumer/AnsettelseConsumer.java | 7 ++++--- .../consumers/AaregConsumer.java | 6 +++--- .../consumer/AaregSyntConsumer.java | 7 ++++--- .../consumer/JenkinsConsumer.java | 6 +++--- .../OrganisasjonBestillingConsumer.java | 7 ++++--- .../consumer/AdresseServiceConsumer.java | 5 +++-- .../consumer/GenererNavnServiceConsumer.java | 5 +++-- .../consumer/MiljoerServiceConsumer.java | 5 +++-- .../OrganisasjonBestillingConsumer.java | 5 +++-- .../OrganisasjonOrgnummerServiceConsumer.java | 5 +++-- .../consumer/OrganisasjonServiceConsumer.java | 5 +++-- .../consumer/JenkinsBatchStatusConsumer.java | 7 ++++--- .../consumer/JenkinsConsumer.java | 6 +++--- .../OrganisasjonBestillingConsumer.java | 7 ++++--- .../consumer/EregConsumer.java | 7 ++++--- .../consumer/altinn/v1/AltinnConsumer.java | 6 +++--- .../maskinporten/v1/MaskinportenConsumer.java | 4 ++-- .../consumer/OrganisasjonConsumer.java | 10 +++++----- .../consumer/AppTilgangAnalyseConsumer.java | 7 ++++--- .../consumer/BrukerConsumer.java | 8 ++++---- .../PersonOrganisasjonTilgangConsumer.java | 7 ++++--- .../consumer/AdresseServiceConsumer.java | 7 ++++--- .../consumer/GenererNavnServiceConsumer.java | 7 ++++--- .../forvalter/consumer/IdentPoolConsumer.java | 9 +++++---- .../forvalter/consumer/KodeverkConsumer.java | 6 +++--- .../consumer/OrganisasjonForvalterConsumer.java | 6 +++--- .../forvalter/consumer/PdlTestdataConsumer.java | 7 ++++--- .../consumer/PersonServiceConsumer.java | 5 +++-- .../consumer/command/PdlDeleteCommandPdl.java | 1 + .../command/PdlDeleteHendelseIdCommandPdl.java | 1 + .../consumer/command/PdlTestdataCommand.java | 14 ++------------ .../consumer/ElasticSearchConsumer.java | 7 ++++--- .../consumer/v1/PdlApiConsumer.java | 7 ++++--- .../consumer/v1/PdlTestdataConsumer.java | 12 ++++++++---- .../profil/consumer/AzureAdProfileConsumer.java | 6 +++--- .../PersonOrganisasjonTilgangConsumer.java | 6 +++--- .../consumer/SokosSkattekortConsumer.java | 5 +++-- .../consumer/ArbeidsforholdConsumer.java | 8 ++++---- .../consumer/HelsepersonellConsumer.java | 9 ++++----- .../consumer/OrganisasjonConsumer.java | 7 ++++--- .../consumer/PdlProxyConsumer.java | 8 ++++---- .../consumer/SykemeldingConsumer.java | 8 ++++---- .../consumer/SyntElsamConsumer.java | 7 ++++--- .../consumer/ArenaForvalterConsumer.java | 6 +++--- .../consumer/InntektstubConsumer.java | 7 ++++--- .../consumer/OrgFasteDataServiceConsumer.java | 6 +++--- .../consumer/PdlProxyConsumer.java | 9 ++++----- .../consumer/PensjonTestdataFacadeConsumer.java | 8 ++++---- .../consumer/PersonSearchConsumer.java | 7 ++++--- .../consumer/SyntDagpengerConsumer.java | 9 +++++---- .../consumer/SyntVedtakshistorikkConsumer.java | 7 ++++--- .../consumers/DollyBackendConsumer.java | 7 ++++--- .../consumers/MaskinportenConsumer.java | 4 ++-- .../consumers/PdlDataConsumer.java | 5 +++-- .../consumers/TenorConsumer.java | 6 +++--- .../consumers/TenorOrganisasjonConsumer.java | 6 +++--- .../consumers/TpsMessagingConsumer.java | 7 ++++--- .../consumer/rs/aareg/AaregConsumer.java | 5 +++-- .../consumer/rs/kodeverk/KodeverkConsumer.java | 6 +++--- .../consumer/rs/navn/GenererNavnConsumer.java | 7 ++++--- .../rs/organisasjon/OrganisasjonConsumer.java | 7 ++++--- .../OrganisasjonFasteDataConsumer.java | 6 +++--- .../tilbakemeldingapi/config/AppConfig.java | 15 ++++++++------- .../consumer/ProfilApiConsumer.java | 8 ++++---- .../consumer/TestmiljoerServiceConsumer.java | 7 ++++--- .../reactivecore/config/WebClientConfig.java | 6 ++++-- .../libs/slack/consumer/SlackConsumer.java | 17 ++++++++--------- .../consumer/FakedingsConsumer.java | 6 ++---- 96 files changed, 348 insertions(+), 302 deletions(-) diff --git a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/consumer/PdlAdresseConsumer.java b/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/consumer/PdlAdresseConsumer.java index c70e707f816..466a3cc022a 100644 --- a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/consumer/PdlAdresseConsumer.java +++ b/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/consumer/PdlAdresseConsumer.java @@ -11,17 +11,18 @@ @Service public class PdlAdresseConsumer { + private final WebClient webClient; private final TokenExchange tokenExchange; private final ServerProperties serverProperties; public PdlAdresseConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { this.tokenExchange = tokenExchange; serverProperties = consumers.getPdlServices(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/consumer/OppsummeringsdokumentConsumer.java b/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/consumer/OppsummeringsdokumentConsumer.java index 10d74261df4..3c258ca0eac 100644 --- a/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/consumer/OppsummeringsdokumentConsumer.java +++ b/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/consumer/OppsummeringsdokumentConsumer.java @@ -30,10 +30,11 @@ public class OppsummeringsdokumentConsumer { public OppsummeringsdokumentConsumer( Consumers consumers, ObjectMapper objectMapper, - ApplicationProperties applicationProperties) { + ApplicationProperties applicationProperties, + WebClient.Builder webClientBuilder) { + this.applicationProperties = applicationProperties; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(consumers.getOppsummeringsdokumentService().getUrl()) .codecs( clientDefaultCodecsConfigurer -> { diff --git a/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/consumer/GithubConsumer.java b/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/consumer/GithubConsumer.java index 70ba49ba4fc..e572685e64d 100644 --- a/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/consumer/GithubConsumer.java +++ b/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/consumer/GithubConsumer.java @@ -18,10 +18,11 @@ public class GithubConsumer { private static final int PAGE_SIZE = 100; private final WebClient webClient; - public GithubConsumer(@Value("${consumers.github.url}") String url, @Value("${consumers.github.token}") String token) { + public GithubConsumer(@Value("${consumers.github.url}") String url, + @Value("${consumers.github.token}") String token, + WebClient.Builder webClientBuilder) { - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(url) .defaultHeader(HttpHeaders.AUTHORIZATION, "token " + token) .exchangeStrategies(ExchangeStrategies.builder() diff --git a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/consumer/AaregConsumer.java b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/consumer/AaregConsumer.java index a148b946e8e..047258608c0 100644 --- a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/consumer/AaregConsumer.java +++ b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/consumer/AaregConsumer.java @@ -32,7 +32,9 @@ public class AaregConsumer { public AaregConsumer( Consumers consumers, TokenExchange tokenExchange, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavAaregProxy(); this.tokenExchange = tokenExchange; ExchangeStrategies jacksonStrategy = ExchangeStrategies @@ -47,8 +49,7 @@ public AaregConsumer( .jackson2JsonDecoder(new Jackson2JsonDecoder(objectMapper, MediaType.APPLICATION_JSON)); }) .build(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(jacksonStrategy) .baseUrl(serverProperties.getUrl()) .build(); diff --git a/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/consumer/PersonOrganisasjonTilgangConsumer.java b/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/consumer/PersonOrganisasjonTilgangConsumer.java index e48fb284892..0a947be0817 100644 --- a/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/consumer/PersonOrganisasjonTilgangConsumer.java +++ b/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/consumer/PersonOrganisasjonTilgangConsumer.java @@ -23,7 +23,8 @@ public class PersonOrganisasjonTilgangConsumer { public PersonOrganisasjonTilgangConsumer( Consumers consumers, TokenExchange tokenExchange, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavPersonOrganisasjonTilgangService(); this.tokenExchange = tokenExchange; ExchangeStrategies jacksonStrategy = ExchangeStrategies @@ -36,8 +37,7 @@ public PersonOrganisasjonTilgangConsumer( .jackson2JsonDecoder(new Jackson2JsonDecoder(objectMapper, MediaType.APPLICATION_JSON)); }) .build(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(jacksonStrategy) .baseUrl(serverProperties.getUrl()) .build(); diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterClient.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterClient.java index b4aabdc45b5..96127319d0d 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterClient.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterClient.java @@ -141,6 +141,7 @@ public Flux gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly log.warn("Persondata for {} gir tom response fra PDL", dollyPerson.getIdent()); } }) + .filter(utvidetPersondata -> !utvidetPersondata.getT1().isEmpty()) .flatMap(utvidetPersondata -> Flux.concat( opprettPersoner(dollyPerson.getIdent(), tilgjengeligeMiljoer, utvidetPersondata.getT1()) .map(response -> PENSJON_FORVALTER + decodeStatus(response, dollyPerson.getIdent())), @@ -150,6 +151,7 @@ public Flux gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly ) .collectList() .doOnNext(statusResultat::addAll) + .filter(status -> status.stream().allMatch(entry -> entry.contains("OK"))) .map(status -> Flux.just(bestilling1) .filter(bestilling2 -> nonNull(bestilling2.getPensjonforvalter())) .map(RsDollyUtvidetBestilling::getPensjonforvalter) diff --git a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/BrukerConsumer.java b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/BrukerConsumer.java index bdc919d207d..8bca85b7d72 100644 --- a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/BrukerConsumer.java +++ b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/BrukerConsumer.java @@ -19,12 +19,12 @@ public class BrukerConsumer { private final AccessService accessService; public BrukerConsumer(TestnavBrukerServiceProperties serviceProperties, - AccessService accessService) { + AccessService accessService, + WebClient.Builder webClientBuilder) { this.serviceProperties = serviceProperties; this.accessService = accessService; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serviceProperties.getUrl()) .build(); } diff --git a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/PersonOrganisasjonTilgangConsumer.java b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/PersonOrganisasjonTilgangConsumer.java index fab5a20388f..cec7481322b 100644 --- a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/PersonOrganisasjonTilgangConsumer.java +++ b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/PersonOrganisasjonTilgangConsumer.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; -import no.nav.dolly.web.consumers.command.GetPersonOrganisasjonTilgangCommand; import no.nav.dolly.web.config.Consumers; +import no.nav.dolly.web.consumers.command.GetPersonOrganisasjonTilgangCommand; import no.nav.dolly.web.service.AccessService; import no.nav.testnav.libs.securitycore.domain.ServerProperties; import org.springframework.http.MediaType; @@ -27,7 +27,8 @@ public class PersonOrganisasjonTilgangConsumer { public PersonOrganisasjonTilgangConsumer( Consumers consumers, AccessService accessService, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, + WebClient.Builder webClientBuilder) { this.accessService = accessService; serverProperties = consumers.getTestnavPersonOrganisasjonTilgangService(); @@ -39,8 +40,7 @@ public PersonOrganisasjonTilgangConsumer( .jackson2JsonDecoder(new Jackson2JsonDecoder(objectMapper, MediaType.APPLICATION_JSON)); }).build(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(jacksonStrategy) .baseUrl(serverProperties.getUrl()) .build(); diff --git a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/TilbakemeldingConsumer.java b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/TilbakemeldingConsumer.java index 8d14afe3a97..e7bab00a347 100644 --- a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/TilbakemeldingConsumer.java +++ b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/consumers/TilbakemeldingConsumer.java @@ -23,10 +23,11 @@ public class TilbakemeldingConsumer { public TilbakemeldingConsumer( Consumers consumers, - AccessService accessService) { + AccessService accessService, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnorgeTilbakemeldingApi(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.accessService = accessService; diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/AdresseServiceConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/AdresseServiceConsumer.java index d9234331567..80e1e0bf624 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/AdresseServiceConsumer.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/AdresseServiceConsumer.java @@ -19,11 +19,12 @@ public class AdresseServiceConsumer { public AdresseServiceConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getAdresseService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/GenererNavnServiceConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/GenererNavnServiceConsumer.java index 905d09107e1..0bce9220d90 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/GenererNavnServiceConsumer.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/GenererNavnServiceConsumer.java @@ -20,11 +20,12 @@ public class GenererNavnServiceConsumer { public GenererNavnServiceConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getGenererNavnService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/IdentPoolConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/IdentPoolConsumer.java index 76c17363321..22499838eb4 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/IdentPoolConsumer.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/IdentPoolConsumer.java @@ -20,11 +20,12 @@ public class IdentPoolConsumer { public IdentPoolConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getIdentPool(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsMessagingConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsMessagingConsumer.java index 21ddec3baf5..1b6ae8f6f4f 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsMessagingConsumer.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsMessagingConsumer.java @@ -45,7 +45,8 @@ public class TpsMessagingConsumer { public TpsMessagingConsumer( Consumers consumers, TokenExchange tokenExchange, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTpsMessagingService(); this.accessTokenService = tokenExchange; @@ -59,8 +60,7 @@ public TpsMessagingConsumer( }).build(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(jacksonStrategy) .baseUrl(serverProperties.getUrl()) .build(); diff --git a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/GenererOrganisasjonPopulasjonConsumer.java b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/GenererOrganisasjonPopulasjonConsumer.java index 42a2459962b..5dfcf5e8710 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/GenererOrganisasjonPopulasjonConsumer.java +++ b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/GenererOrganisasjonPopulasjonConsumer.java @@ -17,12 +17,12 @@ public class GenererOrganisasjonPopulasjonConsumer { public GenererOrganisasjonPopulasjonConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavGenererOrganisasjonPopulasjonService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/OppsummeringsdokumentConsumer.java b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/OppsummeringsdokumentConsumer.java index 6e03efdc849..6295bcb421b 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/OppsummeringsdokumentConsumer.java +++ b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/OppsummeringsdokumentConsumer.java @@ -42,15 +42,15 @@ public OppsummeringsdokumentConsumer( TokenExchange tokenExchange, Consumers consumers, ObjectMapper objectMapper, - ApplicationProperties applicationProperties) { + ApplicationProperties applicationProperties, + WebClient.Builder webClientBuilder) { this.applicationProperties = applicationProperties; this.tokenExchange = tokenExchange; serverProperties = consumers.getOppsummeringsdokumentService(); this.executor = Executors.newFixedThreadPool(20); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .codecs(clientDefaultCodecsConfigurer -> { clientDefaultCodecsConfigurer.defaultCodecs().maxInMemorySize(BYTE_COUNT); diff --git a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/OrganisasjonConsumer.java b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/OrganisasjonConsumer.java index bd34e4564e4..2888017d4b3 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/OrganisasjonConsumer.java +++ b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/OrganisasjonConsumer.java @@ -25,12 +25,12 @@ public class OrganisasjonConsumer { public OrganisasjonConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavOrganisasjonService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/SyntArbeidsforholdConsumer.java b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/SyntArbeidsforholdConsumer.java index 399f55a85d2..c5c9f646508 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/SyntArbeidsforholdConsumer.java +++ b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/consumer/SyntArbeidsforholdConsumer.java @@ -28,13 +28,13 @@ public class SyntArbeidsforholdConsumer { public SyntArbeidsforholdConsumer( TokenExchange tokenExchange, Consumers consumers, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, + WebClient.Builder webClientBuilder) { this.tokenExchange = tokenExchange; serverProperties = consumers.getSyntAmelding(); this.objectMapper = objectMapper; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .codecs(clientDefaultCodecsConfigurer -> { clientDefaultCodecsConfigurer diff --git a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/consumer/GenererNavnConsumer.java b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/consumer/GenererNavnConsumer.java index 42d16167a22..af487760bc2 100644 --- a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/consumer/GenererNavnConsumer.java +++ b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/consumer/GenererNavnConsumer.java @@ -17,11 +17,12 @@ public class GenererNavnConsumer { public GenererNavnConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getGenererNavnService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/consumer/OrgnummerConsumer.java b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/consumer/OrgnummerConsumer.java index 81c2a2806ca..4a9f19f6288 100644 --- a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/consumer/OrgnummerConsumer.java +++ b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/consumer/OrgnummerConsumer.java @@ -16,11 +16,12 @@ public class OrgnummerConsumer { public OrgnummerConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavOrgnummerService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/consumer/SyntAmeldingConsumer.java b/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/consumer/SyntAmeldingConsumer.java index 5ff0de5ac43..5203673b2b1 100644 --- a/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/consumer/SyntAmeldingConsumer.java +++ b/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/consumer/SyntAmeldingConsumer.java @@ -22,11 +22,12 @@ public class SyntAmeldingConsumer { private final TokenExchange tokenExchange; public SyntAmeldingConsumer(TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getSyntAmelding(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies( ExchangeStrategies .builder() diff --git a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/consumer/DokmotConsumer.java b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/consumer/DokmotConsumer.java index 69bef3f8937..be978f19afc 100644 --- a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/consumer/DokmotConsumer.java +++ b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/consumer/DokmotConsumer.java @@ -27,11 +27,12 @@ public class DokmotConsumer { public DokmotConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getTestnavDokarkivProxy(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/consumer/GenererInntektsmeldingConsumer.java b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/consumer/GenererInntektsmeldingConsumer.java index 95cbc6b5c26..e92e383fbba 100644 --- a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/consumer/GenererInntektsmeldingConsumer.java +++ b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/consumer/GenererInntektsmeldingConsumer.java @@ -7,7 +7,6 @@ import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.libs.servletsecurity.exchange.TokenExchange; import org.springframework.stereotype.Component; - import org.springframework.web.reactive.function.client.WebClient; @Slf4j @@ -20,11 +19,12 @@ public class GenererInntektsmeldingConsumer { public GenererInntektsmeldingConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getInntektsmeldingGeneratorService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/consumer/JenkinsConsumer.java b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/consumer/JenkinsConsumer.java index a4f9c271894..e3d4a8eb563 100644 --- a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/consumer/JenkinsConsumer.java +++ b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/consumer/JenkinsConsumer.java @@ -20,11 +20,12 @@ public class JenkinsConsumer { public JenkinsConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getJenkins(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/consumer/OrganisasjonBestillingConsumer.java b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/consumer/OrganisasjonBestillingConsumer.java index 9a5dd53e756..13858e1ba8b 100644 --- a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/consumer/OrganisasjonBestillingConsumer.java +++ b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/consumer/OrganisasjonBestillingConsumer.java @@ -27,11 +27,12 @@ public class OrganisasjonBestillingConsumer { public OrganisasjonBestillingConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getOrganisasjonBestillingService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .clientConnector( new ReactorClientHttpConnector( diff --git a/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/consumer/SafConsumer.java b/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/consumer/SafConsumer.java index 88268b987eb..9e2554dc013 100644 --- a/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/consumer/SafConsumer.java +++ b/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/consumer/SafConsumer.java @@ -24,11 +24,12 @@ public class SafConsumer { public SafConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getTestnavSafProxy(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies( ExchangeStrategies .builder() diff --git a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/AaregConsumer.java b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/AaregConsumer.java index 5531a2f78b6..2a0301db1d6 100644 --- a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/AaregConsumer.java +++ b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/AaregConsumer.java @@ -23,13 +23,13 @@ public class AaregConsumer { public AaregConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { this.serverProperties = consumers.getTestnavAaregProxy(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/KodeverkServiceConsumer.java b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/KodeverkServiceConsumer.java index 58ab931b0bd..7b82e557049 100644 --- a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/KodeverkServiceConsumer.java +++ b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/KodeverkServiceConsumer.java @@ -24,14 +24,14 @@ public class KodeverkServiceConsumer { public KodeverkServiceConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavKodeverkService(); ExchangeStrategies exchangeStrategies = ExchangeStrategies.builder() .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(16 * 1024 * 1024)) .build(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .exchangeStrategies(exchangeStrategies) .build(); diff --git a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/TenorConsumer.java b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/TenorConsumer.java index cd36369f24d..4d858848f87 100644 --- a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/TenorConsumer.java +++ b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/consumers/TenorConsumer.java @@ -29,13 +29,13 @@ public class TenorConsumer { public TenorConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { this.serverProperties = consumers.getTestnavTenorSearchService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/consumer/AnsettelseConsumer.java b/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/consumer/AnsettelseConsumer.java index 374d3b6458d..cac383c2548 100644 --- a/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/consumer/AnsettelseConsumer.java +++ b/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/consumer/AnsettelseConsumer.java @@ -15,12 +15,13 @@ public class AnsettelseConsumer { private final TokenExchange tokenExchange; public AnsettelseConsumer(Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + this.serverProperties = consumers.getLevendeArbeidsforholdAnsettelse(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/consumers/AaregConsumer.java b/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/consumers/AaregConsumer.java index c295c2c2f26..22f79d6762f 100644 --- a/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/consumers/AaregConsumer.java +++ b/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/consumers/AaregConsumer.java @@ -22,13 +22,13 @@ public class AaregConsumer { public AaregConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { this.serverProperties = consumers.getTestnavAaregProxy(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/consumer/AaregSyntConsumer.java b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/consumer/AaregSyntConsumer.java index ffc3c7e5d2e..0116efe3d81 100644 --- a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/consumer/AaregSyntConsumer.java +++ b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/consumer/AaregSyntConsumer.java @@ -21,11 +21,12 @@ public class AaregSyntConsumer { public AaregSyntConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getAaregSyntServices(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/consumer/JenkinsConsumer.java b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/consumer/JenkinsConsumer.java index d047e9feb0a..5e72d181c92 100644 --- a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/consumer/JenkinsConsumer.java +++ b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/consumer/JenkinsConsumer.java @@ -24,11 +24,11 @@ public class JenkinsConsumer { public JenkinsConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { this.tokenExchange = tokenExchange; serverProperties = consumers.getJenkins(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/consumer/OrganisasjonBestillingConsumer.java b/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/consumer/OrganisasjonBestillingConsumer.java index 440f5fd21f3..eb4ff2d22a3 100644 --- a/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/consumer/OrganisasjonBestillingConsumer.java +++ b/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/consumer/OrganisasjonBestillingConsumer.java @@ -18,11 +18,12 @@ public class OrganisasjonBestillingConsumer { public OrganisasjonBestillingConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getOrganisasjonBestillingService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/AdresseServiceConsumer.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/AdresseServiceConsumer.java index d8661811e24..51c6c948412 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/AdresseServiceConsumer.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/AdresseServiceConsumer.java @@ -24,10 +24,11 @@ public class AdresseServiceConsumer { public AdresseServiceConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavAdresseService(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/GenererNavnServiceConsumer.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/GenererNavnServiceConsumer.java index e04b155cd30..f9f181d421f 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/GenererNavnServiceConsumer.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/GenererNavnServiceConsumer.java @@ -23,10 +23,11 @@ public class GenererNavnServiceConsumer { public GenererNavnServiceConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getGenererNavnService(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/MiljoerServiceConsumer.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/MiljoerServiceConsumer.java index 11a478c19b1..2160584e457 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/MiljoerServiceConsumer.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/MiljoerServiceConsumer.java @@ -25,10 +25,11 @@ public class MiljoerServiceConsumer { public MiljoerServiceConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavMiljoerService(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonBestillingConsumer.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonBestillingConsumer.java index 3311898bf6c..51f1bbf146b 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonBestillingConsumer.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonBestillingConsumer.java @@ -22,10 +22,11 @@ public class OrganisasjonBestillingConsumer { public OrganisasjonBestillingConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getOrganisasjonBestillingService(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonOrgnummerServiceConsumer.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonOrgnummerServiceConsumer.java index 5dda07d389f..f82281c1fec 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonOrgnummerServiceConsumer.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonOrgnummerServiceConsumer.java @@ -28,10 +28,11 @@ public class OrganisasjonOrgnummerServiceConsumer { public OrganisasjonOrgnummerServiceConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavOrgnummerService(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonServiceConsumer.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonServiceConsumer.java index 2affeb18fd8..bb1ebedf8ee 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonServiceConsumer.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/consumer/OrganisasjonServiceConsumer.java @@ -25,9 +25,10 @@ public class OrganisasjonServiceConsumer { public OrganisasjonServiceConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavOrganisasjonService(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/JenkinsBatchStatusConsumer.java b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/JenkinsBatchStatusConsumer.java index 41b250e67e3..d846ce360ea 100644 --- a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/JenkinsBatchStatusConsumer.java +++ b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/JenkinsBatchStatusConsumer.java @@ -15,11 +15,12 @@ public class JenkinsBatchStatusConsumer { public JenkinsBatchStatusConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getJenkinsBatchStatusService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/JenkinsConsumer.java b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/JenkinsConsumer.java index cbca5cea52c..69735f96cd1 100644 --- a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/JenkinsConsumer.java +++ b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/JenkinsConsumer.java @@ -29,14 +29,14 @@ public JenkinsConsumer( Consumers consumers, TokenExchange tokenExchange, JenkinsBatchStatusConsumer jenkinsBatchStatusConsumer, - OrganisasjonBestillingConsumer organisasjonBestillingConsumer) { + OrganisasjonBestillingConsumer organisasjonBestillingConsumer, + WebClient.Builder webClientBuilder) { this.organisasjonBestillingConsumer = organisasjonBestillingConsumer; serverProperties = consumers.getJenkins(); this.tokenExchange = tokenExchange; this.jenkinsBatchStatusConsumer = jenkinsBatchStatusConsumer; this.env = env; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/OrganisasjonBestillingConsumer.java b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/OrganisasjonBestillingConsumer.java index 89190fa8aad..8183dcd33f8 100644 --- a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/OrganisasjonBestillingConsumer.java +++ b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/consumer/OrganisasjonBestillingConsumer.java @@ -18,11 +18,12 @@ public class OrganisasjonBestillingConsumer { public OrganisasjonBestillingConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getOrganisasjonBestillingService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/consumer/EregConsumer.java b/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/consumer/EregConsumer.java index 094eb3ff75c..a812283949b 100644 --- a/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/consumer/EregConsumer.java +++ b/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/consumer/EregConsumer.java @@ -21,10 +21,11 @@ public class EregConsumer { public EregConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavEregProxy(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/consumer/altinn/v1/AltinnConsumer.java b/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/consumer/altinn/v1/AltinnConsumer.java index d84b885271a..7f80d72c961 100644 --- a/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/consumer/altinn/v1/AltinnConsumer.java +++ b/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/consumer/altinn/v1/AltinnConsumer.java @@ -32,12 +32,12 @@ public class AltinnConsumer { public AltinnConsumer( AltinnConfig altinnConfig, MaskinportenConsumer maskinportenConsumer, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, + WebClient.Builder webClientBuilder) { this.altinnConfig = altinnConfig; this.maskinportenConsumer = maskinportenConsumer; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(altinnConfig.getUrl()) .codecs(clientDefaultCodecsConfigurer -> { clientDefaultCodecsConfigurer diff --git a/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/consumer/maskinporten/v1/MaskinportenConsumer.java b/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/consumer/maskinporten/v1/MaskinportenConsumer.java index 39aabddfba6..9e6c4ab55e4 100644 --- a/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/consumer/maskinporten/v1/MaskinportenConsumer.java +++ b/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/consumer/maskinporten/v1/MaskinportenConsumer.java @@ -33,9 +33,9 @@ public class MaskinportenConsumer { private final MaskinportenConfig maskinportenConfig; private final Mono accessToken; - public MaskinportenConsumer(MaskinportenConfig maskinportenConfig) { + public MaskinportenConsumer(MaskinportenConfig maskinportenConfig, WebClient.Builder webClientBuilder) { - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .build(); this.maskinportenConfig = maskinportenConfig; diff --git a/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/consumer/OrganisasjonConsumer.java b/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/consumer/OrganisasjonConsumer.java index ee5f741461d..689e23c3878 100644 --- a/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/consumer/OrganisasjonConsumer.java +++ b/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/consumer/OrganisasjonConsumer.java @@ -30,16 +30,16 @@ public class OrganisasjonConsumer { public OrganisasjonConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + miljoerServerProperties = consumers.getTestnavMiljoerService(); organisasjonServerProperties = consumers.getTestnavOrganisasjonService(); this.tokenExchange = tokenExchange; - this.organisasjonWebClient = WebClient - .builder() + this.organisasjonWebClient = webClientBuilder .baseUrl(organisasjonServerProperties.getUrl()) .build(); - this.miljoerWebClient = WebClient - .builder() + this.miljoerWebClient = webClientBuilder .baseUrl(miljoerServerProperties.getUrl()) .build(); } diff --git a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/AppTilgangAnalyseConsumer.java b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/AppTilgangAnalyseConsumer.java index c7b7112ffe6..c9c780e71c5 100644 --- a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/AppTilgangAnalyseConsumer.java +++ b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/AppTilgangAnalyseConsumer.java @@ -23,11 +23,12 @@ public class AppTilgangAnalyseConsumer { public AppTilgangAnalyseConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavAppTilgangAnalyseService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/BrukerConsumer.java b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/BrukerConsumer.java index 706b76f469d..8f459282ea3 100644 --- a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/BrukerConsumer.java +++ b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/BrukerConsumer.java @@ -8,7 +8,6 @@ import no.nav.testnav.libs.reactivesecurity.exchange.TokenExchange; import no.nav.testnav.libs.securitycore.domain.ServerProperties; import org.springframework.stereotype.Component; - import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; @@ -21,11 +20,12 @@ public class BrukerConsumer { public BrukerConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavBrukerService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/PersonOrganisasjonTilgangConsumer.java b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/PersonOrganisasjonTilgangConsumer.java index 273a13b01a4..05fcb8a1528 100644 --- a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/PersonOrganisasjonTilgangConsumer.java +++ b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/consumer/PersonOrganisasjonTilgangConsumer.java @@ -28,7 +28,9 @@ public class PersonOrganisasjonTilgangConsumer { public PersonOrganisasjonTilgangConsumer( Consumers consumers, TokenExchange tokenExchange, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavPersonOrganisasjonTilgangService(); this.tokenExchange = tokenExchange; ExchangeStrategies jacksonStrategy = ExchangeStrategies @@ -43,8 +45,7 @@ public PersonOrganisasjonTilgangConsumer( .jackson2JsonDecoder(new Jackson2JsonDecoder(objectMapper, MediaType.APPLICATION_JSON)); }) .build(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(jacksonStrategy) .baseUrl(serverProperties.getUrl()) .build(); diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/AdresseServiceConsumer.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/AdresseServiceConsumer.java index 046b71bb2cb..94320d1df9f 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/AdresseServiceConsumer.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/AdresseServiceConsumer.java @@ -27,11 +27,12 @@ public class AdresseServiceConsumer { public AdresseServiceConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getAdresseService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/GenererNavnServiceConsumer.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/GenererNavnServiceConsumer.java index 846e880269c..586c29feca2 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/GenererNavnServiceConsumer.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/GenererNavnServiceConsumer.java @@ -26,11 +26,12 @@ public class GenererNavnServiceConsumer { public GenererNavnServiceConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getGenererNavnService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/IdentPoolConsumer.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/IdentPoolConsumer.java index db2acef4d5f..9f7a6d8a5b5 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/IdentPoolConsumer.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/IdentPoolConsumer.java @@ -27,18 +27,19 @@ public class IdentPoolConsumer { private static final String RELEASE_IDENTS_URL = ACQUIRE_IDENTS_URL + "/frigjoer"; private static final String IBRUK_IDENTS_URL = ACQUIRE_IDENTS_URL + "/bruk"; private static final String REKVIRERT_AV = "rekvirertAv="; - private final WebClient webClient; + private final WebClient webClient; private final TokenExchange tokenExchange; private final ServerProperties serverProperties; public IdentPoolConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getIdentPool(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/KodeverkConsumer.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/KodeverkConsumer.java index 1e868346b28..284520e570a 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/KodeverkConsumer.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/KodeverkConsumer.java @@ -30,11 +30,11 @@ public class KodeverkConsumer { public KodeverkConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { this.tokenExchange = tokenExchange; serverProperties = consumers.getKodeverkService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/OrganisasjonForvalterConsumer.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/OrganisasjonForvalterConsumer.java index de64e4e8d97..5a7b90c958e 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/OrganisasjonForvalterConsumer.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/OrganisasjonForvalterConsumer.java @@ -22,11 +22,11 @@ public class OrganisasjonForvalterConsumer { public OrganisasjonForvalterConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { this.tokenExchange = tokenExchange; serverProperties = consumers.getOrgForvalter(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/PdlTestdataConsumer.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/PdlTestdataConsumer.java index 2f00e4dde84..9ef407c692f 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/PdlTestdataConsumer.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/PdlTestdataConsumer.java @@ -53,11 +53,12 @@ public PdlTestdataConsumer( TokenExchange tokenExchange, Consumers consumers, ObjectMapper objectMapper, - PersonServiceConsumer personServiceConsumer) { + PersonServiceConsumer personServiceConsumer, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getPdlProxy(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .filters(exchangeFilterFunctions -> exchangeFilterFunctions.add(logRequest())) .build(); diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/PersonServiceConsumer.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/PersonServiceConsumer.java index 0c31f69b528..3e2c0cd371a 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/PersonServiceConsumer.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/PersonServiceConsumer.java @@ -25,10 +25,11 @@ public class PersonServiceConsumer { private final ServerProperties serverProperties; private final TokenExchange tokenExchange; - public PersonServiceConsumer(Consumers consumers, TokenExchange tokenExchange) { + public PersonServiceConsumer(Consumers consumers, TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { this.serverProperties = consumers.getPersonService(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlDeleteCommandPdl.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlDeleteCommandPdl.java index 15b7d8b6858..e9893d63bf4 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlDeleteCommandPdl.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlDeleteCommandPdl.java @@ -17,6 +17,7 @@ import java.time.Duration; import static no.nav.pdl.forvalter.utils.PdlTestDataUrls.TemaGrunnlag.GEN; +import static no.nav.testnav.libs.reactivecore.utils.WebClientFilter.getMessage; @Slf4j @RequiredArgsConstructor diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlDeleteHendelseIdCommandPdl.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlDeleteHendelseIdCommandPdl.java index 4e494822e78..f54c28cdf0b 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlDeleteHendelseIdCommandPdl.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlDeleteHendelseIdCommandPdl.java @@ -17,6 +17,7 @@ import java.time.Duration; import static no.nav.pdl.forvalter.utils.PdlTestDataUrls.TemaGrunnlag.GEN; +import static no.nav.testnav.libs.reactivecore.utils.WebClientFilter.getMessage; @Slf4j @RequiredArgsConstructor diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlTestdataCommand.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlTestdataCommand.java index 08085808bb7..e7d21bdf345 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlTestdataCommand.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/consumer/command/PdlTestdataCommand.java @@ -2,11 +2,9 @@ import no.nav.testnav.libs.data.pdlforvalter.v1.OrdreResponseDTO; import no.nav.testnav.libs.data.pdlforvalter.v1.PdlStatus; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.reactive.function.client.WebClientResponseException; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; import reactor.core.publisher.Flux; -import java.nio.charset.StandardCharsets; import java.util.concurrent.Callable; public abstract class PdlTestdataCommand implements Callable> { @@ -14,20 +12,12 @@ public abstract class PdlTestdataCommand implements Callable configurer diff --git a/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/consumer/PersonOrganisasjonTilgangConsumer.java b/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/consumer/PersonOrganisasjonTilgangConsumer.java index 2f466963955..3e1df266723 100644 --- a/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/consumer/PersonOrganisasjonTilgangConsumer.java +++ b/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/consumer/PersonOrganisasjonTilgangConsumer.java @@ -27,7 +27,8 @@ public class PersonOrganisasjonTilgangConsumer { public PersonOrganisasjonTilgangConsumer( Consumers consumers, TokenExchange tokenExchange, - ObjectMapper objectMapper + ObjectMapper objectMapper, + WebClient.Builder webClientBuilder ) { serverProperties = consumers.getTestnavPersonOrganisasjonTilgangService(); this.tokenExchange = tokenExchange; @@ -43,8 +44,7 @@ public PersonOrganisasjonTilgangConsumer( .jackson2JsonDecoder(new Jackson2JsonDecoder(objectMapper, MediaType.APPLICATION_JSON)); }) .build(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(jacksonStrategy) .baseUrl(serverProperties.getUrl()) .build(); diff --git a/apps/skattekort-service/src/main/java/no/nav/skattekortservice/consumer/SokosSkattekortConsumer.java b/apps/skattekort-service/src/main/java/no/nav/skattekortservice/consumer/SokosSkattekortConsumer.java index 8369eddab21..be2aa1cda38 100644 --- a/apps/skattekort-service/src/main/java/no/nav/skattekortservice/consumer/SokosSkattekortConsumer.java +++ b/apps/skattekort-service/src/main/java/no/nav/skattekortservice/consumer/SokosSkattekortConsumer.java @@ -19,10 +19,11 @@ public class SokosSkattekortConsumer { private final TokenExchange tokenExchange; private final ServerProperties serverProperties; - public SokosSkattekortConsumer(TokenExchange tokenExchange, Consumers consumers) { + public SokosSkattekortConsumer(TokenExchange tokenExchange, Consumers consumers, + WebClient.Builder webClientBuilder) { this.serverProperties = consumers.getSokosSkattekort(); - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/ArbeidsforholdConsumer.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/ArbeidsforholdConsumer.java index dab75aeb371..0c51f4388dc 100644 --- a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/ArbeidsforholdConsumer.java +++ b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/ArbeidsforholdConsumer.java @@ -8,7 +8,6 @@ import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.libs.servletsecurity.exchange.TokenExchange; import org.springframework.stereotype.Component; - import org.springframework.web.reactive.function.client.WebClient; @Component @@ -20,11 +19,12 @@ public class ArbeidsforholdConsumer { public ArbeidsforholdConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getTestnavArbeidsforholdService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/HelsepersonellConsumer.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/HelsepersonellConsumer.java index 764ecafc324..8cd27ace590 100644 --- a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/HelsepersonellConsumer.java +++ b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/HelsepersonellConsumer.java @@ -9,10 +9,8 @@ import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.libs.servletsecurity.exchange.TokenExchange; import org.springframework.stereotype.Component; - import org.springframework.web.reactive.function.client.WebClient; - import static java.util.Objects.nonNull; @Slf4j @@ -24,11 +22,12 @@ public class HelsepersonellConsumer { public HelsepersonellConsumer( TokenExchange tokenExchange, - Consumers consumers) { + Consumers consumers, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; serverProperties = consumers.getTestnavHelsepersonellService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/OrganisasjonConsumer.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/OrganisasjonConsumer.java index 9ec63bd3238..b00df816bf5 100644 --- a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/OrganisasjonConsumer.java +++ b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/OrganisasjonConsumer.java @@ -18,11 +18,12 @@ public class OrganisasjonConsumer { public OrganisasjonConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavOrganisasjonService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/PdlProxyConsumer.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/PdlProxyConsumer.java index 2b718ea5212..52d2327642a 100644 --- a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/PdlProxyConsumer.java +++ b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/PdlProxyConsumer.java @@ -9,7 +9,6 @@ import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.libs.servletsecurity.exchange.TokenExchange; import org.springframework.stereotype.Component; - import org.springframework.web.reactive.function.client.ExchangeStrategies; import org.springframework.web.reactive.function.client.WebClient; @@ -33,11 +32,12 @@ public class PdlProxyConsumer { public PdlProxyConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavPdlProxy(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(ExchangeStrategies .builder() .codecs(configurer -> configurer diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SykemeldingConsumer.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SykemeldingConsumer.java index ebdbb06776e..60acfddd441 100644 --- a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SykemeldingConsumer.java +++ b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SykemeldingConsumer.java @@ -7,7 +7,6 @@ import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.libs.servletsecurity.exchange.TokenExchange; import org.springframework.stereotype.Component; - import org.springframework.web.reactive.function.client.WebClient; @Slf4j @@ -20,11 +19,12 @@ public class SykemeldingConsumer { public SykemeldingConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getSykemeldingApi(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SyntElsamConsumer.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SyntElsamConsumer.java index b24c6224954..1a754f8a8e1 100644 --- a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SyntElsamConsumer.java +++ b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/consumer/SyntElsamConsumer.java @@ -27,11 +27,12 @@ public class SyntElsamConsumer { public SyntElsamConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getSyntSykemelding(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(ExchangeStrategies .builder() .codecs(configurer -> configurer diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/ArenaForvalterConsumer.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/ArenaForvalterConsumer.java index ebf6163dd63..2818e64a80e 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/ArenaForvalterConsumer.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/ArenaForvalterConsumer.java @@ -50,10 +50,10 @@ public class ArenaForvalterConsumer { public ArenaForvalterConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavArenaForvalterenProxy(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/InntektstubConsumer.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/InntektstubConsumer.java index 7af751749ac..472d20b2265 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/InntektstubConsumer.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/InntektstubConsumer.java @@ -25,11 +25,12 @@ public class InntektstubConsumer { public InntektstubConsumer( Consumers consumers, - TokenExchange tokenExchange + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder ) { + serverProperties = consumers.getTestnavInntektstubProxy(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/OrgFasteDataServiceConsumer.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/OrgFasteDataServiceConsumer.java index 396e5f80bcf..c9200ebfbbb 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/OrgFasteDataServiceConsumer.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/OrgFasteDataServiceConsumer.java @@ -22,11 +22,11 @@ public class OrgFasteDataServiceConsumer { public OrgFasteDataServiceConsumer( Consumers consumers, - TokenExchange tokenExchange + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder ) { serverProperties = consumers.getTestnavOrganisasjonFasteDataService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PdlProxyConsumer.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PdlProxyConsumer.java index 317d5aa4fc6..cbbeec5edcb 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PdlProxyConsumer.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PdlProxyConsumer.java @@ -13,7 +13,6 @@ import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.libs.standalone.servletsecurity.exchange.TokenExchange; import org.springframework.stereotype.Service; - import org.springframework.web.reactive.function.client.WebClient; import java.io.BufferedReader; @@ -40,10 +39,10 @@ public class PdlProxyConsumer { public PdlProxyConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getPdlApiProxy(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; @@ -57,7 +56,7 @@ public PdlPerson getPdlPerson(String ident) { .flatMap(accessToken -> new GetPdlPersonCommand(ident, query, accessToken.getTokenValue(), webClient).call()) .block(); if (nonNull(response) && nonNull(response.getErrors()) && !response.getErrors().isEmpty()) { - log.error("Klarte ikke hente pdlperson: " + response.getErrors().get(0).getMessage()); + log.error("Klarte ikke hente pdlperson: " + response.getErrors().getFirst().getMessage()); return null; } return response; diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PensjonTestdataFacadeConsumer.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PensjonTestdataFacadeConsumer.java index 71b796916a7..6892e98de3d 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PensjonTestdataFacadeConsumer.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PensjonTestdataFacadeConsumer.java @@ -10,7 +10,6 @@ import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.libs.standalone.servletsecurity.exchange.TokenExchange; import org.springframework.stereotype.Component; - import org.springframework.web.reactive.function.client.WebClient; import java.util.Collections; @@ -25,10 +24,11 @@ public class PensjonTestdataFacadeConsumer { public PensjonTestdataFacadeConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavPensjonTestdataFacadeProxy(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PersonSearchConsumer.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PersonSearchConsumer.java index 73b1f62f91c..091388e2309 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PersonSearchConsumer.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/PersonSearchConsumer.java @@ -20,10 +20,11 @@ public class PersonSearchConsumer { public PersonSearchConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavPersonSearchService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntDagpengerConsumer.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntDagpengerConsumer.java index 47f801aafd2..d50f42adaef 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntDagpengerConsumer.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntDagpengerConsumer.java @@ -26,12 +26,13 @@ public class SyntDagpengerConsumer { public SyntDagpengerConsumer( Consumers consumers, - TokenExchange tokenExchange + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder ) { + serverProperties = consumers.getSyntDagpenger(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(ExchangeStrategies .builder() .codecs(configurer -> configurer @@ -50,7 +51,7 @@ public DagpengevedtakDTO syntetiserDagpengevedtak(Dagpengerettighet rettighet, L .flatMap(accessToken -> new HentDagpengevedtakCommand(webClient, request, rettighet, accessToken.getTokenValue()).call()) .block(); if (nonNull(response) && !response.isEmpty()) { - return response.get(0); + return response.getFirst(); } else { return null; } diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntVedtakshistorikkConsumer.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntVedtakshistorikkConsumer.java index e2b7dda6bb8..dd54ea2a46c 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntVedtakshistorikkConsumer.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/consumer/SyntVedtakshistorikkConsumer.java @@ -32,11 +32,12 @@ public class SyntVedtakshistorikkConsumer { public SyntVedtakshistorikkConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getSyntVedtakshistorikk(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(ExchangeStrategies .builder() .codecs(configurer -> configurer diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/DollyBackendConsumer.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/DollyBackendConsumer.java index 416987bc971..32484fc723c 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/DollyBackendConsumer.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/DollyBackendConsumer.java @@ -23,11 +23,12 @@ public class DollyBackendConsumer { private final ServerProperties dollyBackendProperties; private final ServerProperties dollyBackendPropertiesDev; - public DollyBackendConsumer(TokenExchange tokenExchange, Consumers serverProperties) { - this.webClient = WebClient.builder() + public DollyBackendConsumer(TokenExchange tokenExchange, Consumers serverProperties, + WebClient.Builder webClientBuilder) { + this.webClient = webClientBuilder .baseUrl(serverProperties.getDollyBackend().getUrl()) .build(); - this.webClientDev = WebClient.builder() + this.webClientDev = webClientBuilder .baseUrl(serverProperties.getDollyBackendDev().getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/MaskinportenConsumer.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/MaskinportenConsumer.java index 6d3ef30af55..bebb2a85031 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/MaskinportenConsumer.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/MaskinportenConsumer.java @@ -35,8 +35,8 @@ public class MaskinportenConsumer { private final MaskinportenConfig maskinportenConfig; private final Mono accessToken; - public MaskinportenConsumer(MaskinportenConfig maskinportenConfig) { - this.webClient = WebClient.builder().build(); + public MaskinportenConsumer(MaskinportenConfig maskinportenConfig, WebClient.Builder webClientBuilder) { + this.webClient = webClientBuilder.build(); this.maskinportenConfig = maskinportenConfig; var wellKnownMono = cache( new GetWellKnownCommand(webClient, maskinportenConfig).call(), diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/PdlDataConsumer.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/PdlDataConsumer.java index 49b443e14f8..5a4a6848871 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/PdlDataConsumer.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/PdlDataConsumer.java @@ -18,8 +18,9 @@ public class PdlDataConsumer { private final TokenExchange tokenExchange; private final ServerProperties serverProperties; - public PdlDataConsumer(TokenExchange tokenExchange, Consumers serverProperties) { - this.webClient = WebClient.builder() + public PdlDataConsumer(TokenExchange tokenExchange, Consumers serverProperties, + WebClient.Builder webClientBuilder) { + this.webClient = webClientBuilder .baseUrl(serverProperties.getPdlTestdata().getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/TenorConsumer.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/TenorConsumer.java index 32eafede071..fc287c1c867 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/TenorConsumer.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/TenorConsumer.java @@ -15,10 +15,10 @@ public class TenorConsumer { private final WebClient webClient; private final MaskinportenConsumer maskinportenConsumer; - public TenorConsumer(Consumers consumers, MaskinportenConsumer maskinportenConsumer) { + public TenorConsumer(Consumers consumers, MaskinportenConsumer maskinportenConsumer, + WebClient.Builder webClientBuilder) { - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(consumers.getTenorSearchService().getUrl()) .codecs(configurer -> configurer.defaultCodecs() .maxInMemorySize(32 * 1024 * 1024)) diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/TenorOrganisasjonConsumer.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/TenorOrganisasjonConsumer.java index 5c07cd3d8ac..4a763aca41e 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/TenorOrganisasjonConsumer.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/TenorOrganisasjonConsumer.java @@ -15,10 +15,10 @@ public class TenorOrganisasjonConsumer { private final WebClient webClient; private final MaskinportenConsumer maskinportenConsumer; - public TenorOrganisasjonConsumer(Consumers consumers, MaskinportenConsumer maskinportenConsumer) { + public TenorOrganisasjonConsumer(Consumers consumers, MaskinportenConsumer maskinportenConsumer, + WebClient.Builder webClientBuilder) { - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(consumers.getTenorSearchService().getUrl()) .codecs(configurer -> configurer.defaultCodecs() .maxInMemorySize(32 * 1024 * 1024)) diff --git a/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/consumers/TpsMessagingConsumer.java b/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/consumers/TpsMessagingConsumer.java index e03bdb2d486..83034bf0316 100644 --- a/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/consumers/TpsMessagingConsumer.java +++ b/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/consumers/TpsMessagingConsumer.java @@ -29,11 +29,12 @@ public class TpsMessagingConsumer { public TpsMessagingConsumer( Consumers consumers, - TokenExchange tokenExchange + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder ) { + serverProperties = consumers.getTpsMessagingService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/aareg/AaregConsumer.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/aareg/AaregConsumer.java index b28f5abb52d..03eae9cd6f8 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/aareg/AaregConsumer.java +++ b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/aareg/AaregConsumer.java @@ -21,11 +21,12 @@ public class AaregConsumer { public AaregConsumer( Consumers consumers, - TokenExchange tokenExchange + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder ) { serverProperties = consumers.getTestnavAaregProxy(); this.tokenExchange = tokenExchange; - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .exchangeStrategies(ExchangeStrategies.builder() .codecs(configurer -> configurer .defaultCodecs() 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 cb09d31d5ac..a26bc753f5b 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 @@ -12,10 +12,10 @@ public class KodeverkConsumer { private final WebClient webClient; public KodeverkConsumer( - Consumers consumers + Consumers consumers, + WebClient.Builder webClientBuilder ) { - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .exchangeStrategies(ExchangeStrategies .builder() .codecs(configurer -> configurer diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/navn/GenererNavnConsumer.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/navn/GenererNavnConsumer.java index a5b1777416e..b7847825b79 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/navn/GenererNavnConsumer.java +++ b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/navn/GenererNavnConsumer.java @@ -17,11 +17,12 @@ public class GenererNavnConsumer { public GenererNavnConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + this.tokenExchange = tokenExchange; properties = consumers.getGenererNavnService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(properties.getUrl()) .build(); } diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/organisasjon/OrganisasjonConsumer.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/organisasjon/OrganisasjonConsumer.java index 4f4e19f2b6f..67e3c58f004 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/organisasjon/OrganisasjonConsumer.java +++ b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/organisasjon/OrganisasjonConsumer.java @@ -25,12 +25,13 @@ public class OrganisasjonConsumer { public OrganisasjonConsumer( Consumers consumers, - TokenExchange tokenExchange) { + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder) { + serverProperties = consumers.getTestnavOrganisasjonService(); this.tokenExchange = tokenExchange; this.executor = Executors.newFixedThreadPool(serverProperties.getThreads()); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/organisasjon/OrganisasjonFasteDataConsumer.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/organisasjon/OrganisasjonFasteDataConsumer.java index 0ac80b476b4..20e52d6d3a1 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/organisasjon/OrganisasjonFasteDataConsumer.java +++ b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/consumer/rs/organisasjon/OrganisasjonFasteDataConsumer.java @@ -27,12 +27,12 @@ public class OrganisasjonFasteDataConsumer { public OrganisasjonFasteDataConsumer( Consumers consumers, TokenExchange tokenExchange, - GenererNavnConsumer genererNavnConsumer) { + GenererNavnConsumer genererNavnConsumer, + WebClient.Builder webClientBuilder) { serverProperties = consumers.getTestnavOrganisasjonFasteDataService(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.genererNavnConsumer = genererNavnConsumer; diff --git a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/AppConfig.java b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/AppConfig.java index 9eeae2a47eb..dd1a572a7bc 100644 --- a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/AppConfig.java +++ b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/AppConfig.java @@ -1,14 +1,14 @@ package no.nav.registre.testnorge.tilbakemeldingapi.config; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; - import no.nav.testnav.libs.servletcore.config.ApplicationCoreConfig; import no.nav.testnav.libs.servletcore.config.ApplicationProperties; import no.nav.testnav.libs.servletsecurity.config.SecureOAuth2ServerToServerConfiguration; import no.nav.testnav.libs.slack.consumer.SlackConsumer; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.web.reactive.function.client.WebClient; @Configuration @Import({ @@ -22,9 +22,10 @@ public SlackConsumer slackConsumer( @Value("${consumers.slack.token}") String token, @Value("${consumers.slack.baseUrl}") String baseUrl, @Value("${http.proxy:#{null}}") String proxyHost, - ApplicationProperties properties + ApplicationProperties properties, + WebClient .Builder webClientBuilder ) { - return new SlackConsumer(token, baseUrl, proxyHost, properties.getName()); + return new SlackConsumer(token, baseUrl, proxyHost, properties.getName(), webClientBuilder); } diff --git a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/consumer/ProfilApiConsumer.java b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/consumer/ProfilApiConsumer.java index 96c77de3c7b..1b96a8692ba 100644 --- a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/consumer/ProfilApiConsumer.java +++ b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/consumer/ProfilApiConsumer.java @@ -8,7 +8,6 @@ import no.nav.testnav.libs.servletsecurity.exchange.TokenExchange; import org.springframework.http.HttpHeaders; import org.springframework.stereotype.Component; - import org.springframework.web.reactive.function.client.WebClient; import reactor.util.retry.Retry; @@ -24,12 +23,13 @@ public class ProfilApiConsumer { public ProfilApiConsumer( Consumers consumers, - TokenExchange tokenExchange + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder ) { + serverProperties = consumers.getProfilApi(); this.tokenExchange = tokenExchange; - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TestmiljoerServiceConsumer.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TestmiljoerServiceConsumer.java index 2337605971b..c8cb9a791dd 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TestmiljoerServiceConsumer.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TestmiljoerServiceConsumer.java @@ -22,11 +22,12 @@ public class TestmiljoerServiceConsumer { public TestmiljoerServiceConsumer( Consumers consumers, - TokenExchange tokenExchange + TokenExchange tokenExchange, + WebClient.Builder webClientBuilder ) { + serverProperties = consumers.getTestmiljoerService(); - this.webClient = WebClient - .builder() + this.webClient = webClientBuilder .baseUrl(serverProperties.getUrl()) .build(); this.tokenExchange = tokenExchange; diff --git a/libs/reactive-core/src/main/java/no/nav/testnav/libs/reactivecore/config/WebClientConfig.java b/libs/reactive-core/src/main/java/no/nav/testnav/libs/reactivecore/config/WebClientConfig.java index 2652f2ac20c..541a1dcae74 100644 --- a/libs/reactive-core/src/main/java/no/nav/testnav/libs/reactivecore/config/WebClientConfig.java +++ b/libs/reactive-core/src/main/java/no/nav/testnav/libs/reactivecore/config/WebClientConfig.java @@ -9,6 +9,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.web.reactive.function.client.ClientRequestObservationConvention; import org.springframework.web.reactive.function.client.DefaultClientRequestObservationConvention; @@ -23,6 +24,7 @@ public class WebClientConfig { @Bean + @Primary public WebClient.Builder webClientBuilder(ApplicationContext context) { try { @@ -43,14 +45,14 @@ public WebClient.Builder webClientBuilder(ApplicationContext context) { .create(ConnectionProvider.builder("Testnorge connection pool") .maxConnections(5) .pendingAcquireMaxCount(10000) - .pendingAcquireTimeout(Duration.ofMinutes(30)) + .pendingAcquireTimeout(Duration.ofSeconds(300)) .build()) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000) .option(ChannelOption.SO_KEEPALIVE, true) .option(EpollChannelOption.TCP_KEEPIDLE, 300) .option(EpollChannelOption.TCP_KEEPINTVL, 60) .option(EpollChannelOption.TCP_KEEPCNT, 8) - .responseTimeout(Duration.ofSeconds(30)) + .responseTimeout(Duration.ofSeconds(5)) )); } catch (NoSuchBeanDefinitionException e) { diff --git a/libs/slack/src/main/java/no/nav/testnav/libs/slack/consumer/SlackConsumer.java b/libs/slack/src/main/java/no/nav/testnav/libs/slack/consumer/SlackConsumer.java index 7460513b6be..33766e4735e 100644 --- a/libs/slack/src/main/java/no/nav/testnav/libs/slack/consumer/SlackConsumer.java +++ b/libs/slack/src/main/java/no/nav/testnav/libs/slack/consumer/SlackConsumer.java @@ -1,6 +1,10 @@ package no.nav.testnav.libs.slack.consumer; import lombok.extern.slf4j.Slf4j; +import no.nav.testnav.libs.slack.command.PublishMessageCommand; +import no.nav.testnav.libs.slack.command.UploadFileCommand; +import no.nav.testnav.libs.slack.dto.Message; +import no.nav.testnav.libs.slack.dto.SlackResponse; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.web.reactive.function.client.WebClient; import reactor.netty.http.client.HttpClient; @@ -8,11 +12,6 @@ import java.net.URI; -import no.nav.testnav.libs.slack.command.PublishMessageCommand; -import no.nav.testnav.libs.slack.command.UploadFileCommand; -import no.nav.testnav.libs.slack.dto.Message; -import no.nav.testnav.libs.slack.dto.SlackResponse; - @Slf4j public class SlackConsumer { private final String token; @@ -23,15 +22,15 @@ public SlackConsumer( String token, String baseUrl, String proxyHost, - String applicationName + String applicationName, + WebClient.Builder webClientBuilder ) { this.token = token; this.applicationName = applicationName; - var builder = WebClient.builder(); if (proxyHost != null) { log.info("Setter opp proxy host {} for Slack api", proxyHost); var uri = URI.create(proxyHost); - builder.clientConnector(new ReactorClientHttpConnector( + webClientBuilder.clientConnector(new ReactorClientHttpConnector( HttpClient .create() .proxy(proxy -> proxy @@ -40,7 +39,7 @@ public SlackConsumer( .port(uri.getPort())) )); } - webClient = builder + this.webClient = webClientBuilder .baseUrl(baseUrl) .build(); } diff --git a/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/consumer/FakedingsConsumer.java b/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/consumer/FakedingsConsumer.java index c439312236d..6714d463d4f 100644 --- a/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/consumer/FakedingsConsumer.java +++ b/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/consumer/FakedingsConsumer.java @@ -1,8 +1,6 @@ package no.nav.testnav.proxies.arbeidsplassencvproxy.consumer; import com.fasterxml.jackson.databind.ObjectMapper; -import no.nav.testnav.libs.reactivesecurity.exchange.TokenExchange; -import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.proxies.arbeidsplassencvproxy.consumer.command.FakedingsGetCommand; import no.nav.testnav.proxies.arbeidsplassencvproxy.util.JacksonExchangeStrategyUtil; import org.springframework.stereotype.Service; @@ -15,9 +13,9 @@ public class FakedingsConsumer { private static final String FAKE_TOKENDINGS_URL = "https://fakedings.intern.dev.nav.no"; private final WebClient webClient; - public FakedingsConsumer(ObjectMapper objectMapper) { + public FakedingsConsumer(ObjectMapper objectMapper, WebClient.Builder webClientBuilder) { - this.webClient = WebClient.builder() + this.webClient = webClientBuilder .baseUrl(FAKE_TOKENDINGS_URL) .exchangeStrategies(JacksonExchangeStrategyUtil.getJacksonStrategy(objectMapper)) .build();