@Test @RunWithCustomExecutor public void givenExportDIPNotFoundThenNotFound() { when(mock.post()).thenReturn(Response.status(Status.NOT_FOUND).build()); assertThatExceptionOfType(VitamClientException.class) .isThrownBy( () -> client .exportDIP(new VitamContext(TENANT_ID).setAccessContract(CONTRACT), JsonHandler.getFromString(queryDsql))) .withMessage(NOT_FOUND); }
@Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, JsonNode dslRequest) throws VitamClientException { try (Response response = make(post().withPath(AccessExtAPI.DIP_API).withHeaders(vitamContext.getHeaders()) .withBody(dslRequest, "dslRequest cannot be null.").withJson())) { check(response); return RequestResponse.parseFromResponse(response, JsonNode.class); } }
AccessExternalClientRest extends DefaultClient implements AccessExternalClient { @Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, JsonNode dslRequest) throws VitamClientException { try (Response response = make(post().withPath(AccessExtAPI.DIP_API).withHeaders(vitamContext.getHeaders()) .withBody(dslRequest, "dslRequest cannot be null.").withJson())) { check(response); return RequestResponse.parseFromResponse(response, JsonNode.class); } } }
AccessExternalClientRest extends DefaultClient implements AccessExternalClient { @Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, JsonNode dslRequest) throws VitamClientException { try (Response response = make(post().withPath(AccessExtAPI.DIP_API).withHeaders(vitamContext.getHeaders()) .withBody(dslRequest, "dslRequest cannot be null.").withJson())) { check(response); return RequestResponse.parseFromResponse(response, JsonNode.class); } } AccessExternalClientRest(AccessExternalClientFactory factory); }
AccessExternalClientRest extends DefaultClient implements AccessExternalClient { @Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, JsonNode dslRequest) throws VitamClientException { try (Response response = make(post().withPath(AccessExtAPI.DIP_API).withHeaders(vitamContext.getHeaders()) .withBody(dslRequest, "dslRequest cannot be null.").withJson())) { check(response); return RequestResponse.parseFromResponse(response, JsonNode.class); } } AccessExternalClientRest(AccessExternalClientFactory factory); @Override RequestResponse<JsonNode> selectUnits(VitamContext vitamContext, JsonNode selectQuery); @Override RequestResponse<JsonNode> selectUnitbyId(VitamContext vitamContext, JsonNode selectQuery, String unitId); @Override RequestResponse<JsonNode> updateUnitbyId(VitamContext vitamContext, JsonNode updateQuery, String unitId); @Override RequestResponse<JsonNode> selectObjectMetadatasByUnitId(VitamContext vitamContext,
        JsonNode selectObjectQuery,
        String unitId); @Override Response getObjectStreamByUnitId(VitamContext vitamContext,
        String unitId,
        String usage,
        int version); @Override RequestResponse<LogbookOperation> selectOperations(VitamContext vitamContext,
        JsonNode select); @Override RequestResponse<LogbookOperation> selectOperationbyId(VitamContext vitamContext,
        String processId, JsonNode select); @Override RequestResponse<LogbookLifecycle> selectUnitLifeCycleById(VitamContext vitamContext, String idUnit,
        JsonNode select); @Override RequestResponse<LogbookLifecycle> selectObjectGroupLifeCycleById(
        VitamContext vitamContext, String idObject, JsonNode select); @Override RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, JsonNode dslRequest); @Override RequestResponse<JsonNode> transfer(VitamContext vitamContext, TransferRequest transferRequest); @Override Response getTransferById(VitamContext vitamContext, String transferId); @Override Response getDIPById(VitamContext vitamContext, String dipId); RequestResponse<JsonNode> reclassification(VitamContext vitamContext, JsonNode reclassificationRequest); @Override RequestResponse<JsonNode> massUpdateUnits(VitamContext vitamContext, JsonNode updateQuery); @Override RequestResponse<JsonNode> massUpdateUnitsRules(VitamContext vitamContext, JsonNode updateRulesQuery); @Override RequestResponse<JsonNode> selectObjects(VitamContext vitamContext, JsonNode selectQuery); @Override RequestResponse<JsonNode> selectUnitsWithInheritedRules(VitamContext vitamContext, JsonNode selectQuery); @Override Response getAccessLog(VitamContext vitamContext, JsonNode params); @Override RequestResponse<JsonNode> launchPreservation(VitamContext vitamContext,
        PreservationRequest preservationRequest); @Override RequestResponse<JsonNode> startEliminationAnalysis(VitamContext vitamContext,
        EliminationRequestBody eliminationRequestBody); @Override RequestResponse<JsonNode> startEliminationAction(VitamContext vitamContext,
        EliminationRequestBody eliminationRequestBody); @Override RequestResponse<JsonNode> computedInheritedRules(VitamContext vitamContext, JsonNode updateQuery); @Override RequestResponse<JsonNode> deleteComputedInheritedRules(VitamContext vitamContext,
        JsonNode deleteComputedInheritedRulesQuery); @Override RequestResponse transferReply(VitamContext vitamContext, InputStream transferReply); }
AccessExternalClientRest extends DefaultClient implements AccessExternalClient { @Override public RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, JsonNode dslRequest) throws VitamClientException { try (Response response = make(post().withPath(AccessExtAPI.DIP_API).withHeaders(vitamContext.getHeaders()) .withBody(dslRequest, "dslRequest cannot be null.").withJson())) { check(response); return RequestResponse.parseFromResponse(response, JsonNode.class); } } AccessExternalClientRest(AccessExternalClientFactory factory); @Override RequestResponse<JsonNode> selectUnits(VitamContext vitamContext, JsonNode selectQuery); @Override RequestResponse<JsonNode> selectUnitbyId(VitamContext vitamContext, JsonNode selectQuery, String unitId); @Override RequestResponse<JsonNode> updateUnitbyId(VitamContext vitamContext, JsonNode updateQuery, String unitId); @Override RequestResponse<JsonNode> selectObjectMetadatasByUnitId(VitamContext vitamContext,
        JsonNode selectObjectQuery,
        String unitId); @Override Response getObjectStreamByUnitId(VitamContext vitamContext,
        String unitId,
        String usage,
        int version); @Override RequestResponse<LogbookOperation> selectOperations(VitamContext vitamContext,
        JsonNode select); @Override RequestResponse<LogbookOperation> selectOperationbyId(VitamContext vitamContext,
        String processId, JsonNode select); @Override RequestResponse<LogbookLifecycle> selectUnitLifeCycleById(VitamContext vitamContext, String idUnit,
        JsonNode select); @Override RequestResponse<LogbookLifecycle> selectObjectGroupLifeCycleById(
        VitamContext vitamContext, String idObject, JsonNode select); @Override RequestResponse<JsonNode> exportDIP(VitamContext vitamContext, JsonNode dslRequest); @Override RequestResponse<JsonNode> transfer(VitamContext vitamContext, TransferRequest transferRequest); @Override Response getTransferById(VitamContext vitamContext, String transferId); @Override Response getDIPById(VitamContext vitamContext, String dipId); RequestResponse<JsonNode> reclassification(VitamContext vitamContext, JsonNode reclassificationRequest); @Override RequestResponse<JsonNode> massUpdateUnits(VitamContext vitamContext, JsonNode updateQuery); @Override RequestResponse<JsonNode> massUpdateUnitsRules(VitamContext vitamContext, JsonNode updateRulesQuery); @Override RequestResponse<JsonNode> selectObjects(VitamContext vitamContext, JsonNode selectQuery); @Override RequestResponse<JsonNode> selectUnitsWithInheritedRules(VitamContext vitamContext, JsonNode selectQuery); @Override Response getAccessLog(VitamContext vitamContext, JsonNode params); @Override RequestResponse<JsonNode> launchPreservation(VitamContext vitamContext,
        PreservationRequest preservationRequest); @Override RequestResponse<JsonNode> startEliminationAnalysis(VitamContext vitamContext,
        EliminationRequestBody eliminationRequestBody); @Override RequestResponse<JsonNode> startEliminationAction(VitamContext vitamContext,
        EliminationRequestBody eliminationRequestBody); @Override RequestResponse<JsonNode> computedInheritedRules(VitamContext vitamContext, JsonNode updateQuery); @Override RequestResponse<JsonNode> deleteComputedInheritedRules(VitamContext vitamContext,
        JsonNode deleteComputedInheritedRulesQuery); @Override RequestResponse transferReply(VitamContext vitamContext, InputStream transferReply); static final String BLANK_QUERY; }