PublicActivityAwardController extends BaseController implements CrudController<PublicActivityAwardResource, PublicActivityAwardResource> { @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{publicActivityId}/awards", method = RequestMethod.POST) public PublicActivityAwardResource createResource(@Valid @RequestBody final PublicActivityAwardResource resource) { LOG.info("Creating PublicActivityAward: {}", resource); return facade.createResource(resource); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{publicActivityId}/awards", method = RequestMethod.POST) PublicActivityAwardResource createResource(@Valid @RequestBody final PublicActivityAwardResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{publicActivityId}/awards/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final PublicActivityAwardResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{publicActivityId}/awards/{id}", method = RequestMethod.GET) PublicActivityAwardResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{publicActivityId}/awards/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{publicActivityId}/awards", method = RequestMethod.GET) PagedResultResource<PublicActivityAwardResource> getPagedResource(final PagedRequest<PublicActivityAwardResource> request); @Resource(name = "publicActivityAwardFacade")
	private Facade<PublicActivityAwardResource, PublicActivityAwardResource, Long> facade; }
@Test public void testCreate() throws Exception { Long publicActivityId = 1L; PublicActivityAwardResource resource = new PublicActivityAwardResource(); resource.setPublicActivityId(publicActivityId); resource.setBegDate(new Date()); String request = getJson(resource, true); String response = getJson(resource, false); when(facade.createResource(any(PublicActivityAwardResource.class))) .thenReturn(resource); mockMvc.perform( post("/publicactivities/{publicActivityId}/awards", publicActivityId).contentType( MediaType.APPLICATION_JSON).content(request)) .andExpect(status().isCreated()) .andExpect(content().string(response)); verify(facade).createResource(resource); }