From bcc9224dbb3c549f545c2f8d2d56357bfdfa24b7 Mon Sep 17 00:00:00 2001 From: kristenhaerum Date: Tue, 19 Sep 2023 12:48:39 +0200 Subject: [PATCH] =?UTF-8?q?Oppdatert=20statush=C3=A5ndtering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../no/nav/dolly/bestilling/pdldata/PdlDataConsumer.java | 4 +++- .../nav/dolly/bestilling/sigrunstub/SigrunStubClient.java | 3 +-- .../sigrunstub/command/SigurunstubPostCommand.java | 7 +++++++ .../sigrunstub/command/SigurunstubPutCommand.java | 7 +++++++ .../bestilling/sigrunstub/dto/SigrunstubResponse.java | 4 +++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/PdlDataConsumer.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/PdlDataConsumer.java index c4bc4e48e70..13e7299d5a8 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/PdlDataConsumer.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/PdlDataConsumer.java @@ -1,6 +1,7 @@ package no.nav.dolly.bestilling.pdldata; import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.channel.ChannelOption; import lombok.extern.slf4j.Slf4j; import no.nav.dolly.bestilling.ConsumerStatus; import no.nav.dolly.bestilling.pdldata.command.PdlDataCheckIdentCommand; @@ -57,7 +58,8 @@ public PdlDataConsumer( .maxConnections(5) .pendingAcquireMaxCount(500) .pendingAcquireTimeout(Duration.ofMinutes(15)) - .build()))) + .build()) + .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000))) .build(); } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/SigrunStubClient.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/SigrunStubClient.java index af40ea922f3..60a79ba9c9d 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/SigrunStubClient.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/SigrunStubClient.java @@ -111,8 +111,7 @@ private static String getStatus(List String.format("Inntektsår: ‰s, feilmelding: %s", status.getInntektsaar(), status.getMessage())) .collect(Collectors.joining(", ")))); } } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/command/SigurunstubPostCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/command/SigurunstubPostCommand.java index 908d5cb3367..943590e962d 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/command/SigurunstubPostCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/command/SigurunstubPostCommand.java @@ -44,6 +44,13 @@ public Mono call() { .header(UserConstant.USER_HEADER_JWT, getUserJwt()) .retrieve() .bodyToMono(SigrunstubResponse.class) + .map(response -> { + for (int i = 0; i < response.getOpprettelseTilbakemeldingsListe().size(); i++) { + response.getOpprettelseTilbakemeldingsListe().get(i).setInntektsaar( + request.get(i).getInntektsaar()); + } + return response; + }) .doOnError(WebClientFilter::logErrorMessage) .onErrorResume(error -> Mono.just(SigrunstubResponse.builder() .errorStatus(WebClientFilter.getStatus(error)) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/command/SigurunstubPutCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/command/SigurunstubPutCommand.java index 86a3b56a364..46863bbf330 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/command/SigurunstubPutCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/command/SigurunstubPutCommand.java @@ -45,6 +45,13 @@ public Mono call() { .bodyValue(request) .retrieve() .bodyToMono(SigrunstubResponse.class) + .map(response -> { + for (int i = 0; i < response.getOpprettelseTilbakemeldingsListe().size(); i++) { + response.getOpprettelseTilbakemeldingsListe().get(i).setInntektsaar( + request.get(i).getInntektsaar()); + } + return response; + }) .doOnError(WebClientFilter::logErrorMessage) .onErrorResume(error -> Mono.just(SigrunstubResponse.builder() .errorStatus(WebClientFilter.getStatus(error)) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/dto/SigrunstubResponse.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/dto/SigrunstubResponse.java index fd631e548b1..04ac663cb67 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/dto/SigrunstubResponse.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sigrunstub/dto/SigrunstubResponse.java @@ -38,10 +38,12 @@ public List getOpprettelseTilbakemeldingsListe() { @AllArgsConstructor public static class OpprettelseTilbakemelding { - private String message; + private String inntektsaar; private String personident; private Integer status; + private String message; + public boolean isOK() { return nonNull(status) && status == 200; }