@Test
public void testGetFileTypes() throws Exception
{

    // Get a list of test file type keys.
    List<FileTypeKey> testFileTypeKeys = Arrays.asList(new FileTypeKey(FORMAT_FILE_TYPE_CODE), new FileTypeKey(FORMAT_FILE_TYPE_CODE_2));
    FileTypeKeys fileTypeKeys = new FileTypeKeys(testFileTypeKeys);
    // Create and persist file type entities.
    when(fileTypeService.getFileTypes()).thenReturn(fileTypeKeys);
    // Retrieve a list of file type keys.
    FileTypeKeys resultFileTypeKeys = fileTypeRestController.getFileTypes();
    // Verify the external calls.
    verify(fileTypeService).getFileTypes();
    verifyNoMoreInteractions(fileTypeService);
    // Validate the returned object.
    assertEquals(fileTypeKeys, resultFileTypeKeys);
}