WorkspaceWorkflowResource { @GET @ApiOperation(value = "Get a workspace workflow by id", response = WorkspaceWorkflowDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of WorkspaceWorkflowDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{workspaceWorkflowId}") @Produces(MediaType.APPLICATION_JSON) public WorkspaceWorkflowDTO getWorkspaceWorkflow( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Workspace workflow id") @PathParam("workspaceWorkflowId") String workspaceWorkflowId) throws EntityNotFoundException, UserNotActiveException, WorkspaceNotEnabledException { WorkspaceWorkflow workspaceWorkflow = workflowService.getWorkspaceWorkflow(workspaceId, workspaceWorkflowId); return mapper.map(workspaceWorkflow, WorkspaceWorkflowDTO.class); } WorkspaceWorkflowResource(); @PostConstruct void init(); @GET @ApiOperation(value = "Get workspace workflow list in given workspace", response = WorkspaceWorkflowDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of WorkspaceWorkflowDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) Response getWorkspaceWorkflowList(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId); @GET @ApiOperation(value = "Get a workspace workflow by id", response = WorkspaceWorkflowDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of WorkspaceWorkflowDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{workspaceWorkflowId}") @Produces(MediaType.APPLICATION_JSON) WorkspaceWorkflowDTO getWorkspaceWorkflow(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Workspace workflow id") @PathParam("workspaceWorkflowId") String workspaceWorkflowId); @POST @ApiOperation(value = "Instantiate a workspace workflow from given workflow model", response = WorkspaceWorkflowDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of WorkspaceWorkflowDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) WorkspaceWorkflowDTO createWorkspaceWorkflow(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Workspace workflow to create") WorkspaceWorkflowCreationDTO workflowCreationDTO); @DELETE @Path("{workspaceWorkflowId}") @ApiOperation(value = "Delete a workspace workflow", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion operation"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) Response deleteWorkspaceWorkflow(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Workspace workflow id") @PathParam("workspaceWorkflowId") String workspaceWorkflowId);  }
@Test public void getWorkspaceWorkflowTest() throws ApplicationException { String workspaceWorkflowId = "id"; WorkspaceWorkflow workflow = new WorkspaceWorkflow(); Mockito.when(workflowService.getWorkspaceWorkflow(workspaceId, workspaceWorkflowId)) .thenReturn(workflow); WorkspaceWorkflowDTO workspaceWorkflow = workspaceWorkflowResource.getWorkspaceWorkflow(workspaceId, workspaceWorkflowId); Assert.assertEquals(workflow.getId(), workspaceWorkflow.getId()); }