@Test public void givenNotFoundWhenDefinitionsWorkflowThenReturnVitamError() { when(mock.get()).thenReturn(Response.status(Status.NOT_FOUND).build()); ThrowingCallable throwingCallable = () -> client.getWorkflowDefinitions(); assertThatThrownBy(throwingCallable) .isInstanceOf(VitamClientInternalException.class); }
@Override public RequestResponse<WorkFlow> getWorkflowDefinitions() throws VitamClientException { Response response = null; try { response = make(get() .withPath(WORKFLOWS_URI) .withJsonAccept() ); check(response); return RequestResponse.parseFromResponse(response, WorkFlow.class); } catch (InvalidParseOperationException | NotAcceptableClientException | WorkspaceClientServerException e) { throw new VitamClientException(e); } catch (VitamClientInternalException | IngestInternalClientServerException | IngestInternalClientNotFoundException | IngestInternalClientConflictException e) { throw new VitamClientInternalException(e); } finally { if (response != null) { response.close(); } } }
IngestInternalClientRest extends DefaultClient implements IngestInternalClient { @Override public RequestResponse<WorkFlow> getWorkflowDefinitions() throws VitamClientException { Response response = null; try { response = make(get() .withPath(WORKFLOWS_URI) .withJsonAccept() ); check(response); return RequestResponse.parseFromResponse(response, WorkFlow.class); } catch (InvalidParseOperationException | NotAcceptableClientException | WorkspaceClientServerException e) { throw new VitamClientException(e); } catch (VitamClientInternalException | IngestInternalClientServerException | IngestInternalClientNotFoundException | IngestInternalClientConflictException e) { throw new VitamClientInternalException(e); } finally { if (response != null) { response.close(); } } } }
IngestInternalClientRest extends DefaultClient implements IngestInternalClient { @Override public RequestResponse<WorkFlow> getWorkflowDefinitions() throws VitamClientException { Response response = null; try { response = make(get() .withPath(WORKFLOWS_URI) .withJsonAccept() ); check(response); return RequestResponse.parseFromResponse(response, WorkFlow.class); } catch (InvalidParseOperationException | NotAcceptableClientException | WorkspaceClientServerException e) { throw new VitamClientException(e); } catch (VitamClientInternalException | IngestInternalClientServerException | IngestInternalClientNotFoundException | IngestInternalClientConflictException e) { throw new VitamClientInternalException(e); } finally { if (response != null) { response.close(); } } } IngestInternalClientRest(IngestInternalClientFactory factory); }
IngestInternalClientRest extends DefaultClient implements IngestInternalClient { @Override public RequestResponse<WorkFlow> getWorkflowDefinitions() throws VitamClientException { Response response = null; try { response = make(get() .withPath(WORKFLOWS_URI) .withJsonAccept() ); check(response); return RequestResponse.parseFromResponse(response, WorkFlow.class); } catch (InvalidParseOperationException | NotAcceptableClientException | WorkspaceClientServerException e) { throw new VitamClientException(e); } catch (VitamClientInternalException | IngestInternalClientServerException | IngestInternalClientNotFoundException | IngestInternalClientConflictException e) { throw new VitamClientInternalException(e); } finally { if (response != null) { response.close(); } } } IngestInternalClientRest(IngestInternalClientFactory factory); @Override void uploadInitialLogbook(Iterable<LogbookOperationParameters> logbookParametersList); @Override void upload(InputStream inputStream, MediaType archiveMimeType, WorkFlow workflow, String actionAfterInit); @Override void initWorkflow(WorkFlow workFlow); @Override void uploadFinalLogbook(Iterable<LogbookOperationParameters> logbookParametersList); @Override Response downloadObjectAsync(String objectId, IngestCollection type); @Override void storeATR(GUID guid, InputStream input); @Override RequestResponse<ItemStatus> updateOperationActionProcess(String actionId, String operationId); @Override ItemStatus getOperationProcessStatus(String id); @Override RequestResponse<ItemStatus> getOperationProcessExecutionDetails(String id); @Override RequestResponse<ItemStatus> cancelOperationProcessExecution(String id); @Override RequestResponse<ProcessDetail> listOperationsDetails(ProcessQuery query); @Override RequestResponse<WorkFlow> getWorkflowDefinitions(); @Override Optional<WorkFlow> getWorkflowDetails(String workflowIdentifier); }
IngestInternalClientRest extends DefaultClient implements IngestInternalClient { @Override public RequestResponse<WorkFlow> getWorkflowDefinitions() throws VitamClientException { Response response = null; try { response = make(get() .withPath(WORKFLOWS_URI) .withJsonAccept() ); check(response); return RequestResponse.parseFromResponse(response, WorkFlow.class); } catch (InvalidParseOperationException | NotAcceptableClientException | WorkspaceClientServerException e) { throw new VitamClientException(e); } catch (VitamClientInternalException | IngestInternalClientServerException | IngestInternalClientNotFoundException | IngestInternalClientConflictException e) { throw new VitamClientInternalException(e); } finally { if (response != null) { response.close(); } } } IngestInternalClientRest(IngestInternalClientFactory factory); @Override void uploadInitialLogbook(Iterable<LogbookOperationParameters> logbookParametersList); @Override void upload(InputStream inputStream, MediaType archiveMimeType, WorkFlow workflow, String actionAfterInit); @Override void initWorkflow(WorkFlow workFlow); @Override void uploadFinalLogbook(Iterable<LogbookOperationParameters> logbookParametersList); @Override Response downloadObjectAsync(String objectId, IngestCollection type); @Override void storeATR(GUID guid, InputStream input); @Override RequestResponse<ItemStatus> updateOperationActionProcess(String actionId, String operationId); @Override ItemStatus getOperationProcessStatus(String id); @Override RequestResponse<ItemStatus> getOperationProcessExecutionDetails(String id); @Override RequestResponse<ItemStatus> cancelOperationProcessExecution(String id); @Override RequestResponse<ProcessDetail> listOperationsDetails(ProcessQuery query); @Override RequestResponse<WorkFlow> getWorkflowDefinitions(); @Override Optional<WorkFlow> getWorkflowDetails(String workflowIdentifier);  }