MetadataResource { @DELETE @Path("/taskdefs/{tasktype}") @ApiOperation("Remove a task definition") public void unregisterTaskDef(@PathParam("tasktype") String taskType){ metadataService.unregisterTaskDef(taskType); } @Inject  MetadataResource(MetadataService metadataService); @POST @Path("/workflow") @ApiOperation("Create a new workflow definition") void create(WorkflowDef workflowDef); @PUT @Path("/workflow") @ApiOperation("Create or update workflow definition") void update(List<WorkflowDef> workflowDefs); @GET @ApiOperation("Retrieves workflow definition along with blueprint") @Path("/workflow/{name}") WorkflowDef get(@PathParam("name") String name,
						   @QueryParam("version") Integer version); @GET @ApiOperation("Retrieves all workflow definition along with blueprint") @Path("/workflow") List<WorkflowDef> getAll(); @DELETE @Path("/workflow/{name}/{version}") @ApiOperation("Removes workflow definition. It does not remove workflows associated with the definition.") void unregisterWorkflowDef(@PathParam("name") String name,
                                      @PathParam("version") Integer version); @POST @Path("/taskdefs") @ApiOperation("Create new task definition(s)") void registerTaskDef(List<TaskDef> taskDefs); @PUT @Path("/taskdefs") @ApiOperation("Update an existing task") void registerTaskDef(TaskDef taskDef); @GET @Path("/taskdefs") @ApiOperation("Gets all task definition") @Consumes(MediaType.WILDCARD) List<TaskDef> getTaskDefs(); @GET @Path("/taskdefs/{tasktype}") @ApiOperation("Gets the task definition") @Consumes(MediaType.WILDCARD) TaskDef getTaskDef(@PathParam("tasktype") String taskType); @DELETE @Path("/taskdefs/{tasktype}") @ApiOperation("Remove a task definition") void unregisterTaskDef(@PathParam("tasktype") String taskType);  }
@Test public void testUnregisterTaskDef() { metadataResource.unregisterTaskDef("test"); verify(mockMetadataService, times(1)).unregisterTaskDef(anyString()); }