@Test public void givenWorkflowDefinitionsRequestResponseThenReturnOk() throws Exception { doReturn( new RequestResponseOK().addResult(JsonHandler.createObjectNode()).setHttpCode(Status.OK.getStatusCode())) .when(processingClient) .getWorkflowDefinitions(); given().contentType(MediaType.APPLICATION_JSON) .when().get("workflows").then().statusCode(Status.OK.getStatusCode()); }
@GET @Path("/workflows") @Produces(MediaType.APPLICATION_JSON) public Response getWorkflowDefinitions(@Context HttpHeaders headers) { ProcessingManagementClient processingClient = processingManagementClientFactory.getClient(); try { return processingClient.getWorkflowDefinitions().toResponse(); } catch (VitamClientException e) { return Response.serverError().entity(getErrorEntity(Status.INTERNAL_SERVER_ERROR, e.getMessage(), null)) .build(); } }
IngestInternalResource extends ApplicationStatusResource { @GET @Path("/workflows") @Produces(MediaType.APPLICATION_JSON) public Response getWorkflowDefinitions(@Context HttpHeaders headers) { ProcessingManagementClient processingClient = processingManagementClientFactory.getClient(); try { return processingClient.getWorkflowDefinitions().toResponse(); } catch (VitamClientException e) { return Response.serverError().entity(getErrorEntity(Status.INTERNAL_SERVER_ERROR, e.getMessage(), null)) .build(); } } }
IngestInternalResource extends ApplicationStatusResource { @GET @Path("/workflows") @Produces(MediaType.APPLICATION_JSON) public Response getWorkflowDefinitions(@Context HttpHeaders headers) { ProcessingManagementClient processingClient = processingManagementClientFactory.getClient(); try { return processingClient.getWorkflowDefinitions().toResponse(); } catch (VitamClientException e) { return Response.serverError().entity(getErrorEntity(Status.INTERNAL_SERVER_ERROR, e.getMessage(), null)) .build(); } } IngestInternalResource(IngestInternalConfiguration configuration); @VisibleForTesting  IngestInternalResource(WorkspaceClientFactory workspaceClientFactory,
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory); }
IngestInternalResource extends ApplicationStatusResource { @GET @Path("/workflows") @Produces(MediaType.APPLICATION_JSON) public Response getWorkflowDefinitions(@Context HttpHeaders headers) { ProcessingManagementClient processingClient = processingManagementClientFactory.getClient(); try { return processingClient.getWorkflowDefinitions().toResponse(); } catch (VitamClientException e) { return Response.serverError().entity(getErrorEntity(Status.INTERNAL_SERVER_ERROR, e.getMessage(), null)) .build(); } } IngestInternalResource(IngestInternalConfiguration configuration); @VisibleForTesting  IngestInternalResource(WorkspaceClientFactory workspaceClientFactory,
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory); @POST @Path("/logbooks") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response delegateCreateLogbookOperation(Queue<LogbookOperationParameters> queue); @PUT @Path("/logbooks") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response delegateUpdateLogbookOperation(Queue<LogbookOperationParameters> queue); @POST @Path("/ingests") @Consumes({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP, CommonMediaType.XGZIP, CommonMediaType.GZIP, CommonMediaType.TAR, CommonMediaType.BZIP2}) Response uploadSipAsStream(@HeaderParam(HttpHeaders.CONTENT_TYPE) String contentType,
        @HeaderParam(GlobalDataRest.X_CONTEXT_ID) String contextId,
        @HeaderParam(GlobalDataRest.X_ACTION) String actionId,
        @HeaderParam(GlobalDataRest.X_ACTION_INIT) String xActionInit,
        @HeaderParam(GlobalDataRest.X_TYPE_PROCESS) LogbookTypeProcess logbookTypeProcess,
        InputStream uploadedInputStream); @Path("/operations/{id}") @PUT @Produces(MediaType.APPLICATION_JSON) Response updateWorkFlowStatus(@Context HttpHeaders headers, @PathParam("id") String id); @Path("/operations/{id}") @HEAD @Produces(MediaType.APPLICATION_JSON) Response getWorkFlowExecutionStatus(@PathParam("id") String id); @Path("/operations/{id}") @GET @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response getOperationProcessExecutionDetails(@PathParam("id") String id); @Path("/operations/{id}") @DELETE @Produces(MediaType.APPLICATION_JSON) Response cancelOperationProcessExecution(@PathParam("id") String id); @GET @Path("/ingests/{objectId}/{type}") @Produces(MediaType.APPLICATION_OCTET_STREAM) Response downloadObjectAsStream(@PathParam("objectId") String objectId, @PathParam("type") String type); @POST @Path("/ingests/{objectId}/report") @Consumes(MediaType.APPLICATION_OCTET_STREAM) Response storeATR(@PathParam("objectId") String guid, InputStream atr); @GET @Path("/operations") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response listOperationsDetails(@Context HttpHeaders headers, ProcessQuery query); @GET @Path("/workflows") @Produces(MediaType.APPLICATION_JSON) Response getWorkflowDefinitions(@Context HttpHeaders headers); @Path("workflows/{workfowId}") @GET @Produces(MediaType.APPLICATION_JSON) Response getWorkflowDetails(@PathParam("workfowId") String workfowId); }
IngestInternalResource extends ApplicationStatusResource { @GET @Path("/workflows") @Produces(MediaType.APPLICATION_JSON) public Response getWorkflowDefinitions(@Context HttpHeaders headers) { ProcessingManagementClient processingClient = processingManagementClientFactory.getClient(); try { return processingClient.getWorkflowDefinitions().toResponse(); } catch (VitamClientException e) { return Response.serverError().entity(getErrorEntity(Status.INTERNAL_SERVER_ERROR, e.getMessage(), null)) .build(); } } IngestInternalResource(IngestInternalConfiguration configuration); @VisibleForTesting  IngestInternalResource(WorkspaceClientFactory workspaceClientFactory,
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory); @POST @Path("/logbooks") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response delegateCreateLogbookOperation(Queue<LogbookOperationParameters> queue); @PUT @Path("/logbooks") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response delegateUpdateLogbookOperation(Queue<LogbookOperationParameters> queue); @POST @Path("/ingests") @Consumes({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP, CommonMediaType.XGZIP, CommonMediaType.GZIP, CommonMediaType.TAR, CommonMediaType.BZIP2}) Response uploadSipAsStream(@HeaderParam(HttpHeaders.CONTENT_TYPE) String contentType,
        @HeaderParam(GlobalDataRest.X_CONTEXT_ID) String contextId,
        @HeaderParam(GlobalDataRest.X_ACTION) String actionId,
        @HeaderParam(GlobalDataRest.X_ACTION_INIT) String xActionInit,
        @HeaderParam(GlobalDataRest.X_TYPE_PROCESS) LogbookTypeProcess logbookTypeProcess,
        InputStream uploadedInputStream); @Path("/operations/{id}") @PUT @Produces(MediaType.APPLICATION_JSON) Response updateWorkFlowStatus(@Context HttpHeaders headers, @PathParam("id") String id); @Path("/operations/{id}") @HEAD @Produces(MediaType.APPLICATION_JSON) Response getWorkFlowExecutionStatus(@PathParam("id") String id); @Path("/operations/{id}") @GET @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response getOperationProcessExecutionDetails(@PathParam("id") String id); @Path("/operations/{id}") @DELETE @Produces(MediaType.APPLICATION_JSON) Response cancelOperationProcessExecution(@PathParam("id") String id); @GET @Path("/ingests/{objectId}/{type}") @Produces(MediaType.APPLICATION_OCTET_STREAM) Response downloadObjectAsStream(@PathParam("objectId") String objectId, @PathParam("type") String type); @POST @Path("/ingests/{objectId}/report") @Consumes(MediaType.APPLICATION_OCTET_STREAM) Response storeATR(@PathParam("objectId") String guid, InputStream atr); @GET @Path("/operations") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response listOperationsDetails(@Context HttpHeaders headers, ProcessQuery query); @GET @Path("/workflows") @Produces(MediaType.APPLICATION_JSON) Response getWorkflowDefinitions(@Context HttpHeaders headers); @Path("workflows/{workfowId}") @GET @Produces(MediaType.APPLICATION_JSON) Response getWorkflowDetails(@PathParam("workfowId") String workfowId); static final String INGEST_INTERNAL_MODULE; }