EnrolmentStatusController extends BaseController implements CrudController<EnrolmentStatusResource, EnrolmentStatusResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{enrolmentId}/statuses/{id}", method = RequestMethod.PUT) public MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final EnrolmentStatusResource resource) { LOG.info("Updating enrolment status with id : {} , {} ", id, resource); facade.updateResource(id, resource); return new MessageResource(MessageType.INFO, "EnrolmentStatus Updated"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{enrolmentId}/statuses", method = RequestMethod.POST) EnrolmentStatusResource createResource(@Valid @RequestBody final EnrolmentStatusResource enrolmentResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{enrolmentId}/statuses/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id, 
			@Valid @RequestBody final EnrolmentStatusResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{enrolmentId}/statuses/{id}", method = RequestMethod.GET) EnrolmentStatusResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{enrolmentId}/statuses/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{enrolmentId}/statuses", method = RequestMethod.GET) PagedResultResource<EnrolmentStatusResource> getPagedResource(final PagedRequest<EnrolmentStatusResource> request);  }
@Test public void testUpdateEnrolmentStatus() throws Exception { Long id = 1L; Long enrolmentId = 2L; EnrolmentStatusResource enrolmentResource = new EnrolmentStatusResource(); enrolmentResource.setId(id); enrolmentResource.setEnrolmentId(enrolmentId); MessageResource responseResource = new MessageResource( MessageType.INFO, "EnrolmentStatus Updated"); String request = getJson(enrolmentResource, true); String response = getJson(responseResource, false); mockMvc.perform( put("/enrolments/{enrolmentId}/statuses/{id}", enrolmentId, id) .contentType(MediaType.APPLICATION_JSON).content( request)).andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, enrolmentResource); }