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