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