PersonPaperController extends BaseController implements CrudController<PersonPaperResource, PersonPaperResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/papers/{personPaperId}", method = RequestMethod.PUT) @ApiOperation(value = "Update PersonPaper", position = 2) public MessageResource updateResource(@PathVariable("personPaperId") final Long personPaperId, @Valid @RequestBody final PersonPaperResource personPaperResource) { LOG.info("Updating personPaper with id: {}", personPaperResource); facade.updateResource(personPaperId, personPaperResource); return new MessageResource(MessageType.INFO, "Person Paper Updated"); }  @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 testUpdatePersonPaper() throws Exception { Long id = 1L; Long personId = 1L; PersonPaperResource personPaperResource = new PersonPaperResource(); personPaperResource.setDocDate(new Date()); personPaperResource.setPersonId(personId); MessageResource responseResource = new MessageResource(MessageType.INFO, "Person Paper Updated"); String request = getJson(personPaperResource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/persons/{personId}/papers/{id}", personId, id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, personPaperResource); }