Skip to content

Commit

Permalink
Merge pull request #114 from navikt/dev
Browse files Browse the repository at this point in the history
Prodsette #110
  • Loading branch information
slovrid authored Nov 1, 2023
2 parents b9bbee0 + aa461f1 commit 91edaea
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.util.Optional;
import java.util.function.Supplier;

import static no.nav.common.utils.UrlUtils.joinPaths;
import static no.nav.veilarboppgave.util.RestUtils.bearerTokenFromSupplier;
import static org.springframework.http.HttpHeaders.ACCEPT;
import static org.springframework.http.HttpHeaders.AUTHORIZATION;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
Expand All @@ -40,9 +38,10 @@ public VeilarbpersonClientImpl(String veilarbpersonUrl, Supplier<String> userTok
@Override
public Personalia hentPersonalia(Fnr fnr) {
Request request = new Request.Builder()
.url(joinPaths(veilarbpersonUrl, "api/v2/person?fnr=") + fnr)
.url(joinPaths(veilarbpersonUrl, "/api/v3/hent-person"))
.header(ACCEPT, APPLICATION_JSON_VALUE)
.header(AUTHORIZATION, userTokenSupplier.get())
.post(RestUtils.toJsonRequestBody(new PersonRequest(fnr)))
.build();

try (okhttp3.Response response = client.newCall(request).execute()) {
Expand All @@ -61,4 +60,6 @@ private static class GeografiskTilknytningResponse {
String geografiskTilknytning;
}

private record PersonRequest(Fnr fnr) {
}
}

0 comments on commit 91edaea

Please sign in to comment.