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