PersonFamilyController extends BaseController implements CrudController<PersonFamilyResource, PersonFamilyResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/families/{id}", method = RequestMethod.PUT) public MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final PersonFamilyResource resource) { LOG.info("Updated person family with id: {}, {}", id, resource); facade.updateResource(id, resource); return new MessageResource(MessageType.INFO, "PersonFamily Updated"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{personId}/families", method = RequestMethod.POST) PersonFamilyResource createResource(@Valid @RequestBody final PersonFamilyResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/families/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final PersonFamilyResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/families/{id}", method = RequestMethod.GET) PersonFamilyResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/families/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/families", method = RequestMethod.GET) PagedResultResource<PersonFamilyResource> getPagedResource(final PagedRequest<PersonFamilyResource> request);  }
@Test public void testUpdatePersonFamily() throws Exception { Long personId = 2L; Long id = 1L; PersonFamilyResource personFamilyResource = new PersonFamilyResource(); personFamilyResource.setId(id); personFamilyResource.setPersonId(personId); MessageResource responseResource = new MessageResource( MessageType.INFO, "PersonFamily Updated"); String request = getJson(personFamilyResource, true); String response = getJson(responseResource, false); mockMvc.perform( put("/persons/{personId}/families/{contactId}", personId, id) .contentType(MediaType.APPLICATION_JSON).content( request)).andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, personFamilyResource); }