PublicActivityController extends BaseController implements CrudController<PublicActivityResource, PublicActivityResource> { @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) public PublicActivityResource createResource(@Valid @RequestBody final PublicActivityResource personResource) { LOG.info("Creating PublicActivity: {}", personResource); return facade.createResource(personResource); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) PublicActivityResource createResource(@Valid @RequestBody final PublicActivityResource personResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final PublicActivityResource personResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.GET) PublicActivityResource 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<PublicActivityResource> getPagedResource(final PagedRequest<PublicActivityResource> request); @Resource(name = "publicActivityFacade")
	private Facade<PublicActivityResource, PublicActivityResource, Long> facade; }
@Test public void testCreatePublicActivity() throws Exception { PublicActivityResource personResource = new PublicActivityResource(); personResource.setBegDate(new Date()); String request = getJson(personResource, true); String response = getJson(personResource, false); when(facade.createResource(any(PublicActivityResource.class))).thenReturn(personResource); mockMvc.perform(post("/publicactivities") .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isCreated()) .andExpect(content().string(response)); verify(facade).createResource(personResource); }