PersonPensionController extends BaseController implements CrudController<PersonPensionResource, PersonPensionResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/pensions/{personPensionId}", method = RequestMethod.PUT) public MessageResource updateResource(@PathVariable("personPensionId") final Long personPensionId, @Valid @RequestBody final PersonPensionResource personPensionResource) { LOG.info("Updating personPension with id: {}, {}", personPensionId, personPensionResource); facade.updateResource(personPensionId, personPensionResource); return new MessageResource(MessageType.INFO); }  @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 testUpdatePersonPension() throws Exception { Long personId = 2L; Long id = 1L; PersonPensionResource personPensionResource = new PersonPensionResource(); personPensionResource.setId(id); personPensionResource.setPersonId(personId); MessageResource responseResource = new MessageResource(MessageType.INFO); String request = getJson(personPensionResource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/persons/{personId}/pensions/{contactId}", personId, id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, personPensionResource); }