BenefitController extends BaseController implements CrudController<BenefitResource, BenefitResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) public MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final BenefitResource resource) { LOGGER.info("Updating new resource, id:{}, resource:{}", id, resource); facade.updateResource(id, resource); return new MessageResource(MessageType.INFO, "Benefit updated"); }  @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(method = RequestMethod.GET) PagedResultResource<BenefitResource> getPagedResource(final PagedRequest<BenefitResource> request); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.GET) BenefitResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) BenefitResource createResource(@Valid @RequestBody final BenefitResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final BenefitResource resource); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id);  }
@Test public void testUpdateBenefit() throws Exception { Long id = 1L; BenefitResource benefitResource = new BenefitResource(); benefitResource.setId(id); MessageResource responseResource = new MessageResource(MessageType.INFO, "Benefit updated"); String request = getJson(benefitResource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/benefits/{id}", id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, benefitResource); }