WorkflowModelResource { @DELETE @ApiOperation(value = "Delete a workflow model", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of WorkflowModelDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{workflowModelId}") public Response delWorkflowModel( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Workflow model id") @PathParam("workflowModelId") String workflowModelId) throws EntityNotFoundException, AccessRightException, UserNotActiveException, EntityConstraintException, WorkspaceNotEnabledException { workflowService.deleteWorkflowModel(new WorkflowModelKey(workspaceId, workflowModelId)); return Response.noContent().build(); } WorkflowModelResource(); @PostConstruct void init(); @GET @ApiOperation(value = "Get workflow models in given workspace", response = WorkflowModelDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of WorkflowModelDTOs. 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) WorkflowModelDTO[] getWorkflowModelsInWorkspace(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId); @GET @ApiOperation(value = "Get workflow model by id", response = WorkflowModelDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of WorkflowModelDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{workflowModelId}") @Produces(MediaType.APPLICATION_JSON) WorkflowModelDTO getWorkflowModelInWorkspace(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Workflow model id") @PathParam("workflowModelId") String workflowModelId); @DELETE @ApiOperation(value = "Delete a workflow model", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of WorkflowModelDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{workflowModelId}") Response delWorkflowModel(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Workflow model id") @PathParam("workflowModelId") String workflowModelId); @PUT @ApiOperation(value = "Update a workflow model", response = WorkflowModelDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of updated WorkflowModelDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{workflowModelId}") @Produces(MediaType.APPLICATION_JSON) WorkflowModelDTO updateWorkflowModel(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Workflow model id") @PathParam("workflowModelId") String workflowModelId,
            @ApiParam(required = true, value = "Workflow model to update") WorkflowModelDTO workflowModelDTOToPersist); @PUT @ApiOperation(value = "Update workflow model ACL", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful update of WorkflowModelDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{workflowModelId}/acl") @Consumes(MediaType.APPLICATION_JSON) Response updateWorkflowModelACL(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String pWorkspaceId,
            @ApiParam(required = true, value = "Workflow model id") @PathParam("workflowModelId") String workflowModelId,
            @ApiParam(required = true, value = "ACL rules to set") ACLDTO acl); @POST @ApiOperation(value = "Create a new workflow model", response = WorkflowModelDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of created WorkflowModelDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) WorkflowModelDTO createWorkflowModel(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Workflow model to create rules to set") WorkflowModelDTO workflowModelDTOToPersist);  }
@Test public void delWorkflowModelTest() throws ApplicationException { String workflowModelId = "whatever"; Mockito.doNothing().when(workflowService) .deleteWorkflowModel(new WorkflowModelKey(workspaceId, workflowModelId)); Response res = workflowModelResource.delWorkflowModel(workspaceId, workflowModelId); Assert.assertEquals(Response.Status.NO_CONTENT.getStatusCode(), res.getStatus()); }