DepartmentContactController extends BaseController implements CrudController<DepartmentContactResource, DepartmentContactResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{departmentId}/contacts/{id}", method = RequestMethod.DELETE) public MessageResource removeResource(@PathVariable("id") final Long id) { LOG.info("Removing department contact with id: {}", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "DepartmentContact removed"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{departmentId}/contacts", method = RequestMethod.POST) DepartmentContactResource createResource(@Valid @RequestBody final DepartmentContactResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/contacts/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final DepartmentContactResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/contacts/{id}", method = RequestMethod.GET) DepartmentContactResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{departmentId}/contacts/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/contacts", method = RequestMethod.GET) PagedResultResource<DepartmentContactResource> getPagedResource(final PagedRequest<DepartmentContactResource> request);  }
@Test public void testDeleteDepatmentContact() throws Exception { Long personId = 2L; Long contactId = 1L; mockMvc.perform(delete("/departments/{departmentId}/contacts/{contactId}", personId, contactId)) .andExpect(status().is(204)); verify(facade).removeResource(contactId); }