DepartmentNameController extends BaseController implements CrudController<DepartmentNameResource, DepartmentNameResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{departmentId}/names/{id}", method = RequestMethod.DELETE) public MessageResource removeResource(@PathVariable("id") final Long id) { LOG.info("Removing department name with id: {}", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "DepartmentName removed"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{departmentId}/names", method = RequestMethod.POST) DepartmentNameResource createResource(@Valid @RequestBody final DepartmentNameResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/names/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final DepartmentNameResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/names/{id}", method = RequestMethod.GET) DepartmentNameResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{departmentId}/names/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/names", method = RequestMethod.GET) PagedResultResource<DepartmentNameResource> getPagedResource(final PagedRequest<DepartmentNameResource> request);  }
@Test public void testDeleteDepatmentName() throws Exception { Long personId = 2L; Long nameId = 1L; mockMvc.perform(delete("/departments/{departmentId}/names/{nameId}", personId, nameId)) .andExpect(status().is(204)); verify(facade).removeResource(nameId); }