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