FileTypeRestController { @RequestMapping(value = "/fileTypes", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_FILE_TYPES_ALL_GET) public FileTypeKeys getFileTypes() { return fileTypeService.getFileTypes(); }  @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 testGetFileTypes() throws Exception { List<FileTypeKey> testFileTypeKeys = Arrays.asList(new FileTypeKey(FORMAT_FILE_TYPE_CODE), new FileTypeKey(FORMAT_FILE_TYPE_CODE_2)); FileTypeKeys fileTypeKeys = new FileTypeKeys(testFileTypeKeys); when(fileTypeService.getFileTypes()).thenReturn(fileTypeKeys); FileTypeKeys resultFileTypeKeys = fileTypeRestController.getFileTypes(); verify(fileTypeService).getFileTypes(); verifyNoMoreInteractions(fileTypeService); assertEquals(fileTypeKeys, resultFileTypeKeys); }