EnrolmentBenefitController extends BaseController implements CrudController<EnrolmentBenefitResource, EnrolmentBenefitResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{enrolmentId}/benefits/{id}", method = RequestMethod.DELETE) public MessageResource removeResource(@PathVariable("id") final Long id) { LOG.info("Removing enrolment benefit with id : {} ", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "EnrolmentBenefit Removed"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{enrolmentId}/benefits", method = RequestMethod.POST) EnrolmentBenefitResource createResource(@Valid @RequestBody final EnrolmentBenefitResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{enrolmentId}/benefits/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id, 
			@Valid @RequestBody final EnrolmentBenefitResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{enrolmentId}/benefits/{id}", method = RequestMethod.GET) EnrolmentBenefitResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{enrolmentId}/benefits/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{enrolmentId}/benefits" , method = RequestMethod.GET) PagedResultResource<EnrolmentBenefitResource> getPagedResource(final PagedRequest<EnrolmentBenefitResource> request);  }
@Test public void testRemoveEnrolmentBenefit() throws Exception { Long id = 1L; Long enrolmentId = 2L; mockMvc.perform( delete("/enrolments/{enrolmentId}/benefits/{id}", enrolmentId, id)).andExpect(status().is(204)); verify(facade).removeResource(id); }