PartnerController extends BaseController implements CrudController<PartnerResource, PartnerResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) public MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final PartnerResource partnerResource) { LOG.info("Updating partner with id: {}, {}", id, partnerResource); facade.updateResource(id, partnerResource); return new MessageResource(MessageType.INFO, "Partner Updated"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) PartnerResource createResource(@Valid @RequestBody final PartnerResource partnerResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final PartnerResource partnerResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.GET) PartnerResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(method = RequestMethod.GET) PagedResultResource<PartnerResource> getPagedResource(final PagedRequest<PartnerResource> request);  }
@Test public void testUpdatePartner() throws Exception { Long id = 1L; PartnerResource partnerResource = new PartnerResource(); partnerResource.setId(id); partnerResource.setBegDate(new Date()); MessageResource responseResource = new MessageResource(MessageType.INFO, "Partner Updated"); String request = getJson(partnerResource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/partners/{id}", id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, partnerResource); }