SpecOfferSubjectController extends BaseController implements CrudController<SpecOfferSubjectResource, SpecOfferSubjectResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{specOfferId}/subjects/{specOfferSubjectId}", method = RequestMethod.PUT) @ApiOperation(value = "Update Spec Offer Subject", position = 2) public MessageResource updateResource(@PathVariable("specOfferSubjectId") final Long specOfferSubjectId, @RequestBody final SpecOfferSubjectResource resource) { LOG.info("Updating spec offer subject with id: {}, {}", specOfferSubjectId, resource); facade.updateResource(specOfferSubjectId, resource); return new MessageResource(MessageType.INFO, "Spec Offer Subject Updated"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{specOfferId}/subjects", method = RequestMethod.POST) @ApiOperation(value = "Method for creating Spec Offer Subject") SpecOfferSubjectResource createResource(@Valid @RequestBody final SpecOfferSubjectResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{specOfferId}/subjects/{specOfferSubjectId}", method = RequestMethod.PUT) @ApiOperation(value = "Update Spec Offer Subject", position = 2) MessageResource updateResource(@PathVariable("specOfferSubjectId") final Long specOfferSubjectId,
 			@RequestBody final SpecOfferSubjectResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{specOfferId}/subjects/{specOfferSubjectId}", method = RequestMethod.GET) @ApiOperation(value = "Get Spec Offer Subjects by spec offer id", position = 3) SpecOfferSubjectResource getResource(@PathVariable("specOfferSubjectId") final Long specOfferSubjectId); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{specOfferId}/subjects/{specOfferSubjectId}", method = RequestMethod.DELETE) @ApiOperation(value = "Delete Spec Offer Subject", position = 4) MessageResource removeResource(@PathVariable("specOfferSubjectId") final Long specOfferSubjectId); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{specOfferId}/subjects", method = RequestMethod.GET) @ApiOperation(value = "Get Spec Offer Subjects") PagedResultResource<SpecOfferSubjectResource> getPagedResource(final PagedRequest<SpecOfferSubjectResource> request);  }
@Test public void testUpdateSpecOfferSubject() throws Exception { Long id = 1L; Long personId = 1L; SpecOfferSubjectResource specOfferSubjectResource = new SpecOfferSubjectResource(); MessageResource responseResource = new MessageResource(MessageType.INFO, "Spec Offer Subject Updated"); String request = getJson(specOfferSubjectResource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/specoffers/{0}/subjects/{id}", personId, id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, specOfferSubjectResource); }