PersonWorkController extends BaseController implements CrudController<PersonWorkResource, PersonWorkResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/works/{id}", method = RequestMethod.DELETE) public MessageResource removeResource(@PathVariable("id") final Long id) { LOG.info("Removing person work with id: {}", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "PersonWork removed"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{personId}/works", method = RequestMethod.POST) PersonWorkResource createResource(@Valid @RequestBody final PersonWorkResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/works/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final PersonWorkResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/works/{id}", method = RequestMethod.GET) PersonWorkResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/works/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/works", method = RequestMethod.GET) PagedResultResource<PersonWorkResource> getPagedResource(final PagedRequest<PersonWorkResource> request);  }
@Test public void testDeleteDepatmentWork() throws Exception { Long personId = 2L; Long workId = 1L; mockMvc.perform( delete("/persons/{personId}/works/{workId}", personId, workId)).andExpect(status().is(204)); verify(facade).removeResource(workId); }