FileTypeRestController { @RequestMapping(value = "/fileTypes/{fileTypeCode}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_FILE_TYPES_DELETE) public FileType deleteFileType(@PathVariable("fileTypeCode") String fileTypeCode) { return fileTypeService.deleteFileType(new FileTypeKey(fileTypeCode)); }  @RequestMapping(value = "/fileTypes", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_FILE_TYPES_POST) FileType createFileType(@RequestBody FileTypeCreateRequest request); @RequestMapping(value = "/fileTypes/{fileTypeCode}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_FILE_TYPES_GET) FileType getFileType(@PathVariable("fileTypeCode") String fileTypeCode); @RequestMapping(value = "/fileTypes/{fileTypeCode}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_FILE_TYPES_DELETE) FileType deleteFileType(@PathVariable("fileTypeCode") String fileTypeCode); @RequestMapping(value = "/fileTypes", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_FILE_TYPES_ALL_GET) FileTypeKeys getFileTypes();  }
@Test public void testDeleteFileType() throws Exception { FileType fileType = new FileType(FORMAT_FILE_TYPE_CODE); when(fileTypeService.deleteFileType(new FileTypeKey(FORMAT_FILE_TYPE_CODE))).thenReturn(fileType); FileType deletedFileType = fileTypeRestController.deleteFileType(FORMAT_FILE_TYPE_CODE); verify(fileTypeService).deleteFileType(new FileTypeKey(FORMAT_FILE_TYPE_CODE)); verifyNoMoreInteractions(fileTypeService); assertEquals(fileType, deletedFileType); }