PersonEnrolmentSubjectController extends BaseController implements CrudController<PersonEnrolmentSubjectResource, PersonEnrolmentSubjectResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/enrolmentsubjects/{personEnrolmentSubjectId}", method = RequestMethod.DELETE) @ApiOperation(value = "Delete Person Enrolment Subject", position = 4) public MessageResource removeResource(@PathVariable("personEnrolmentSubjectId") final Long id) { LOG.info("Removing personEnrolmentSubject with id: {}", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "PersonEnrolmentSubject removed"); }  @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/enrolmentsubjects", method = RequestMethod.GET) @ApiOperation(value = "Get Person Enrolment Subjects") PagedResultResource<PersonEnrolmentSubjectResource> getPagedResource(final PagedRequest<PersonEnrolmentSubjectResource> request); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/enrolmentsubjects/{personEnrolmentSubjectId}", method = RequestMethod.GET) @ApiOperation(value = "Get Person Enrolment Subjects by id", position = 1) PersonEnrolmentSubjectResource getResource(@PathVariable("personEnrolmentSubjectId") final Long id); @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{personId}/enrolmentsubjects", method = RequestMethod.POST) @ApiOperation(value = "Create Enrolment Subject", position = 2) PersonEnrolmentSubjectResource createResource(@Valid @RequestBody final PersonEnrolmentSubjectResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/enrolmentsubjects/{personEnrolmentSubjectId}", method = RequestMethod.PUT) @ApiOperation(value = "Update PersonName", position = 3) MessageResource updateResource(@PathVariable("personEnrolmentSubjectId") final Long id,
			@Valid @RequestBody final PersonEnrolmentSubjectResource resource); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/enrolmentsubjects/{personEnrolmentSubjectId}", method = RequestMethod.DELETE) @ApiOperation(value = "Delete Person Enrolment Subject", position = 4) MessageResource removeResource(@PathVariable("personEnrolmentSubjectId") final Long id);  }
@Test public void testDeletePersonEnrolmentSubject() throws Exception { Long personId = 2L; Long enrolmentSubjectId = 1L; mockMvc.perform(delete("/persons/{personId}/enrolmentsubjects/{enrolmentSubjectId}", personId, enrolmentSubjectId)).andExpect( status().is(204)); verify(facade).removeResource(enrolmentSubjectId); }