From 3bc64b3c04dab436fb867dcafe9ef9ef1567701f Mon Sep 17 00:00:00 2001 From: Sneha Date: Fri, 27 Sep 2024 14:52:45 +0200 Subject: [PATCH] Oppgraderte versjonen til felles biblioteket (#197) * Oppgraderte versjonen til felles biblioteket * Endret kode i forhold til bumpe versjone til felles bibliotek --- pom.xml | 25 +++++++++++-------- .../Norg2ArbeidsfordelingClientImpl.java | 2 +- .../client/oppgave/OppgaveClientImpl.java | 5 ++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index dd40e95..0246ccf 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 21 - 3.2023.10.23_12.41-bafec3836d28 + 3.2024.09.16_11.09-578823a87a2f 1.20.1 @@ -108,42 +108,42 @@ - com.github.navikt.common-java-modules + no.nav.common util ${common.version} - com.github.navikt.common-java-modules + no.nav.common types ${common.version} - com.github.navikt.common-java-modules + no.nav.common client ${common.version} - com.github.navikt.common-java-modules + no.nav.common token-client ${common.version} - com.github.navikt.common-java-modules + no.nav.common auth ${common.version} - com.github.navikt.common-java-modules + no.nav.common log ${common.version} - com.github.navikt.common-java-modules + no.nav.common health ${common.version} - com.github.navikt.common-java-modules + no.nav.common metrics ${common.version} @@ -156,7 +156,7 @@ test - com.github.navikt.common-java-modules + no.nav.common test ${common.version} test @@ -217,6 +217,9 @@ jitpack https://jitpack.io + + github + https://github-package-registry-mirror.gc.nav.no/cached/maven-release + - diff --git a/src/main/java/no/nav/veilarboppgave/client/norg2/Norg2ArbeidsfordelingClientImpl.java b/src/main/java/no/nav/veilarboppgave/client/norg2/Norg2ArbeidsfordelingClientImpl.java index e3e036f..5fb4189 100644 --- a/src/main/java/no/nav/veilarboppgave/client/norg2/Norg2ArbeidsfordelingClientImpl.java +++ b/src/main/java/no/nav/veilarboppgave/client/norg2/Norg2ArbeidsfordelingClientImpl.java @@ -52,7 +52,7 @@ public List hentBestMatchEnheter(ArbeidsfordelingKriterier krit @Override public HealthCheckResult checkHealth() { - return HealthCheckUtils.pingUrl(UrlUtils.joinPaths(this.norg2Url, "/internal/isAlive"), this.client); + return HealthCheckUtils.pingUrl(UrlUtils.joinPaths(this.norg2Url, "/internal/health/readiness"), this.client); } } diff --git a/src/main/java/no/nav/veilarboppgave/client/oppgave/OppgaveClientImpl.java b/src/main/java/no/nav/veilarboppgave/client/oppgave/OppgaveClientImpl.java index c2b9466..7893c3e 100644 --- a/src/main/java/no/nav/veilarboppgave/client/oppgave/OppgaveClientImpl.java +++ b/src/main/java/no/nav/veilarboppgave/client/oppgave/OppgaveClientImpl.java @@ -71,6 +71,11 @@ public Optional opprettOppgave(Oppgave oppgave) { throw new ResponseStatusException(HttpStatus.FORBIDDEN, "Bruker har ikke tilgang til å opprette oppgave"); } + if(!response.isSuccessful()) { + log.error("Feil i request til oppgave: {}", response.message()); + throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "Feil i request til oppgave"); + } + RestUtils.throwIfNotSuccessful(response); OpprettOppgaveResponse opprettOppgaveResponse = RestUtils.parseJsonResponseOrThrow(response, OpprettOppgaveResponse.class);