DepartmentController extends BaseController implements CrudController<DepartmentResource, DepartmentResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) @ApiOperation(value = "Delete Department by id") public MessageResource removeResource(@PathVariable("id") final Long id) { LOG.info("Removing specoffer with id: {}", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "Department removed"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) @ApiOperation(value = "Create Department") DepartmentResource createResource(@RequestBody final DepartmentResource departmentResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) @ApiOperation(value = "Update Department") MessageResource updateResource(@PathVariable("id") final Long id,
			@RequestBody final DepartmentResource departmentResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.GET) @ApiOperation(value = "Get Department by id") DepartmentResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) @ApiOperation(value = "Delete Department by id") MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "Get Departments") PagedResultResource<DepartmentResource> getPagedResource(final PagedRequest<DepartmentResource> request); @RequestMapping(value = "/timeperiods/{timePeriodId}/specoffers", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) List<DepartmentSpecofferResource> getDepartmentSpecoffers(@PathVariable("timePeriodId") long timePeriodId);  }
@Test public void testDeleteDepartment() throws Exception { Long id = 1L; mockMvc.perform(delete("/departments/{id}", id)) .andExpect(status().is(204)); verify(facade).removeResource(id); }