@Test @RunWithCustomExecutor public void exportDIP() throws Exception { when(mock.post()) .thenReturn( Response.status(Status.OK).entity(ClientMockResultHelper.getLogbookOperationRequestResponse()).build()); DipRequest exportRequest = new DipRequest(JsonHandler.getFromString(queryDsql)); assertThat(client.exportDIP(new VitamContext(TENANT_ID).setAccessContract(CONTRACT), exportRequest)).isNotNull(); }
@Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipRequest dipRequest) throws VitamClientException { VitamRequestBuilder request = post() .withPath(AccessExtAPI.DIP_API) .withHeaders(vitamContext.getHeaders()) .withBody(dipRequest, "DipRequest cannot be null.") .withJson(); try (Response response = make(request)) { return RequestResponse.parseFromResponse(check(response), JsonNode.class); } catch (IllegalStateException e) { throw new VitamClientException(e); } }
AccessExternalClientV2Rest extends DefaultClient implements AccessExternalClientV2 { @Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipRequest dipRequest) throws VitamClientException { VitamRequestBuilder request = post() .withPath(AccessExtAPI.DIP_API) .withHeaders(vitamContext.getHeaders()) .withBody(dipRequest, "DipRequest cannot be null.") .withJson(); try (Response response = make(request)) { return RequestResponse.parseFromResponse(check(response), JsonNode.class); } catch (IllegalStateException e) { throw new VitamClientException(e); } } }
AccessExternalClientV2Rest extends DefaultClient implements AccessExternalClientV2 { @Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipRequest dipRequest) throws VitamClientException { VitamRequestBuilder request = post() .withPath(AccessExtAPI.DIP_API) .withHeaders(vitamContext.getHeaders()) .withBody(dipRequest, "DipRequest cannot be null.") .withJson(); try (Response response = make(request)) { return RequestResponse.parseFromResponse(check(response), JsonNode.class); } catch (IllegalStateException e) { throw new VitamClientException(e); } } AccessExternalClientV2Rest(AccessExternalClientV2Factory factory); }
AccessExternalClientV2Rest extends DefaultClient implements AccessExternalClientV2 { @Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipRequest dipRequest) throws VitamClientException { VitamRequestBuilder request = post() .withPath(AccessExtAPI.DIP_API) .withHeaders(vitamContext.getHeaders()) .withBody(dipRequest, "DipRequest cannot be null.") .withJson(); try (Response response = make(request)) { return RequestResponse.parseFromResponse(check(response), JsonNode.class); } catch (IllegalStateException e) { throw new VitamClientException(e); } } AccessExternalClientV2Rest(AccessExternalClientV2Factory factory); @Override RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipRequest dipRequest); @Override RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipExportRequest dipExportRequest); }
AccessExternalClientV2Rest extends DefaultClient implements AccessExternalClientV2 { @Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipRequest dipRequest) throws VitamClientException { VitamRequestBuilder request = post() .withPath(AccessExtAPI.DIP_API) .withHeaders(vitamContext.getHeaders()) .withBody(dipRequest, "DipRequest cannot be null.") .withJson(); try (Response response = make(request)) { return RequestResponse.parseFromResponse(check(response), JsonNode.class); } catch (IllegalStateException e) { throw new VitamClientException(e); } } AccessExternalClientV2Rest(AccessExternalClientV2Factory factory); @Override RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipRequest dipRequest); @Override RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, DipExportRequest dipExportRequest);  }