AdminResource { @POST @Path("/sweep/requeue/{workflowId}") @ApiOperation("Queue up all the running workflows for sweep") @Consumes({ MediaType.WILDCARD }) @Produces({ MediaType.TEXT_PLAIN }) public String requeueSweep(@PathParam("workflowId") String workflowId) { return adminService.requeueSweep(workflowId); } @Inject  AdminResource(AdminService adminService); @ApiOperation(value = "Get all the configuration parameters") @GET @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.APPLICATION_JSON) @Path("/config") Map<String, Object> getAllConfig(); @GET @Path("/task/{tasktype}") @ApiOperation("Get the list of pending tasks for a given task type") @Consumes({ MediaType.WILDCARD }) List<Task> view(@PathParam("tasktype") String taskType,
                           @DefaultValue("0") @QueryParam("start") Integer start,
                           @DefaultValue("100") @QueryParam("count") Integer count); @POST @Path("/sweep/requeue/{workflowId}") @ApiOperation("Queue up all the running workflows for sweep") @Consumes({ MediaType.WILDCARD }) @Produces({ MediaType.TEXT_PLAIN }) String requeueSweep(@PathParam("workflowId") String workflowId); @POST @Path("/consistency/verifyAndRepair/{workflowId}") @ApiOperation("Verify and repair workflow consistency") @Consumes({ MediaType.WILDCARD }) @Produces({ MediaType.TEXT_PLAIN }) String verifyAndRepairWorkflowConsistency(@PathParam("workflowId") String workflowId);  }
@Test public void testRequeueSweep() { String workflowId = "w123"; when(mockAdminService.requeueSweep(anyString())).thenReturn(workflowId); assertEquals(workflowId, adminResource.requeueSweep(workflowId)); }