PersonAwardController extends BaseController implements CrudController<PersonAwardResource, PersonAwardResource> { @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{personId}/awards", method = RequestMethod.POST) @ApiOperation(value = "Create PersonAward") public PersonAwardResource createResource(@Valid @RequestBody final PersonAwardResource personAwardResource) { LOG.info("Creating personAward: {}", personAwardResource); return facade.createResource(personAwardResource); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{personId}/awards", method = RequestMethod.POST) @ApiOperation(value = "Create PersonAward") PersonAwardResource createResource(@Valid @RequestBody final PersonAwardResource personAwardResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/awards/{personAwardId}", method = RequestMethod.PUT) @ApiOperation(value = "Update PersonAward") MessageResource updateResource(@PathVariable("personAwardId") final Long personAwardId,
 			@Valid @RequestBody final PersonAwardResource personAwardResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/awards/{personAwardId}", method = RequestMethod.GET) @ApiOperation(value = "Get PersonAward by id", position = 3) PersonAwardResource getResource(@PathVariable("personAwardId") final Long personAwardId); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/awards/{personAwardId}", method = RequestMethod.DELETE) @ApiOperation(value = "Delete PersonAward", position = 4) MessageResource removeResource(@PathVariable("personAwardId") final Long personAwardId); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/awards", method = RequestMethod.GET) @ApiOperation(value = "Get PersonAwards") PagedResultResource<PersonAwardResource> getPagedResource(final PagedRequest<PersonAwardResource> request);  }
@Test public void testCreatePersonAward() throws Exception { Long personId = 1L; PersonAwardResource personAwardResource = new PersonAwardResource(); String request = getJson(personAwardResource, true); String response = getJson(personAwardResource, false); when(facade.createResource(any(PersonAwardResource.class))).thenReturn(personAwardResource); mockMvc.perform(post("/persons/{0}/awards", personId) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isCreated()) .andExpect(content().string(response)); verify(facade).createResource(personAwardResource); }