EnrolmentController extends BaseController implements CrudController<EnrolmentResource, EnrolmentResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) @ApiOperation(value = "Remove Enrolment", position = 4) public MessageResource removeResource(@PathVariable("id") final Long id) { LOG.info("Removing enrolment with id : {} ", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "Enrolment Removed"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) @ApiOperation(value = "Create Enrolment", position = 1) EnrolmentResource createResource(@Valid @RequestBody final EnrolmentResource enrolmentResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) @ApiOperation(value = "Update Enrolment", position = 2) MessageResource updateResource(@PathVariable("id") final Long id, 
			@Valid @RequestBody final EnrolmentResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.GET) @ApiOperation(value = "Get Enrolment", position = 3) EnrolmentResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) @ApiOperation(value = "Remove Enrolment", position = 4) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "Get Enrolments") @ApiImplicitParams({ @ApiImplicitParam(name = "offset", value = "Offset", required = false, defaultValue = "0", dataType = "long", paramType = "query"), @ApiImplicitParam(name = "limit", value = "limit", required = false, defaultValue = "20", dataType = "long", paramType = "query"), @ApiImplicitParam(name = "resource", value = "resource", required = false, dataType = "EnrolmentResource", paramType = "EnrolmentResource") }) PagedResultResource<EnrolmentResource> getPagedResource(final PagedRequest<EnrolmentResource> request); @RequestMapping(value = "/{specofferId}/ratings") RatingResource getEnrolmentsRatingResource(@PathVariable("specofferId") long specofferId);  }
@Test public void testRemoveEnrolment() throws Exception { Long id = 1L; mockMvc.perform(delete("/enrolments/{id}", id)) .andExpect(status().is(204)); verify(facade).removeResource(id); }