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