PartnerController extends BaseController implements CrudController<PartnerResource, PartnerResource> { @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) public PartnerResource createResource(@Valid @RequestBody final PartnerResource partnerResource) { LOG.info("Creating partner: {}", partnerResource); return facade.createResource(partnerResource); }  @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 testCreatePartner() throws Exception { PartnerResource partnerResource = new PartnerResource(); partnerResource.setBegDate(new Date()); String request = getJson(partnerResource, true); String response = getJson(partnerResource, false); when(facade.createResource(any(PartnerResource.class))).thenReturn(partnerResource); mockMvc.perform(post("/partners") .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isCreated()) .andExpect(content().string(response)); verify(facade).createResource(partnerResource); }