PersonNameController extends BaseController implements CrudController<PersonNameResource, PersonNameResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/names/{personNameId}", method = RequestMethod.DELETE) @ApiOperation(value = "Delete PersonName") public MessageResource removeResource(@PathVariable("personNameId") final Long personNameId) { LOG.info("Removing personName with id: {}", personNameId); facade.removeResource(personNameId); return new MessageResource(MessageType.INFO, "PersonName removed"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{personId}/names", method = RequestMethod.POST) @ApiOperation(value = "Create PersonName", position = 1) PersonNameResource createResource(@Valid @RequestBody final PersonNameResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/names/{personNameId}", method = RequestMethod.PUT) @ApiOperation(value = "Update PersonName", position = 2) MessageResource updateResource(@PathVariable("personNameId") final Long personNameId,
 			@Valid @RequestBody final PersonNameResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/names/{personNameId}", method = RequestMethod.GET) @ApiOperation(value = "Get PersonName by id", position = 3) PersonNameResource getResource(@PathVariable("personNameId") final Long personNameId); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/names/{personNameId}", method = RequestMethod.DELETE) @ApiOperation(value = "Delete PersonName") MessageResource removeResource(@PathVariable("personNameId") final Long personNameId); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/names", method = RequestMethod.GET) @ApiOperation(value = "Get PersonNames") PagedResultResource<PersonNameResource> getPagedResource(final PagedRequest<PersonNameResource> request);  }
@Test public void testDeletePersonName() throws Exception { Long personId = 2L; Long id = 1L; mockMvc.perform(delete("/persons/{personId}/names/{id}", personId, id)) .andExpect(status().is(204)); verify(facade).removeResource(id); }