From e712a66817156a241181953a5daf11f4e5bd0188 Mon Sep 17 00:00:00 2001 From: Jan Olav Eide <80393418+jan-olaveide@users.noreply.github.com> Date: Wed, 23 Jun 2021 10:32:22 +0200 Subject: [PATCH] invoke (#864) Co-authored-by: Jan-Olav Eide --- .../vedtak/felles/integrasjon/saf/SafJerseyTjeneste.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/integrasjon/saf-klient/src/main/java/no/nav/vedtak/felles/integrasjon/saf/SafJerseyTjeneste.java b/integrasjon/saf-klient/src/main/java/no/nav/vedtak/felles/integrasjon/saf/SafJerseyTjeneste.java index 3a37cb5b6..325d04f01 100644 --- a/integrasjon/saf-klient/src/main/java/no/nav/vedtak/felles/integrasjon/saf/SafJerseyTjeneste.java +++ b/integrasjon/saf-klient/src/main/java/no/nav/vedtak/felles/integrasjon/saf/SafJerseyTjeneste.java @@ -77,13 +77,13 @@ public List hentTilknyttedeJournalposter(TilknyttedeJournalposterQu public byte[] hentDokument(HentDokumentQuery q) { try { LOG.trace("Henter dokument"); - var doc = client.target(base) + var doc = invoke(client.target(base) .path(HENTDOKUMENT) .resolveTemplate("journalpostId", q.getJournalpostId()) .resolveTemplate("dokumentInfoId", q.getDokumentInfoId()) .resolveTemplate("variantFormat", q.getVariantFormat()) .request() - .get(byte[].class); + .buildGet(), byte[].class); LOG.info("Hentet dokument OK"); return doc; } catch (WebApplicationException e) { @@ -100,11 +100,10 @@ public > T query(GraphQLOperationRequest req, GraphQL private > T query(GraphQLRequest req, Class clazz) { try { LOG.trace("Eksekverer GraphQL query {}", req.getClass().getSimpleName()); - var res = client.target(base) + var res = invoke(client.target(base) .path(GRAPHQL) .request(APPLICATION_JSON_TYPE) - .buildPost(json(req.toHttpJsonBody())) - .invoke(clazz); + .buildPost(json(req.toHttpJsonBody())), clazz); if (res.hasErrors()) { return errorHandler.handleError(res.getErrors(), base, F_240613); }