@Test
public void testCreateFileType() throws Exception
{

    FileTypeCreateRequest fileTypeCreateRequest = new FileTypeCreateRequest(FORMAT_FILE_TYPE_CODE);
    // Create a file type.
    FileType fileType = new FileType(FORMAT_FILE_TYPE_CODE);
    when(fileTypeService.createFileType(fileTypeCreateRequest)).thenReturn(fileType);
    FileType resultFileType = fileTypeRestController.createFileType(new FileTypeCreateRequest(FORMAT_FILE_TYPE_CODE));
    // Validate the returned object.
    assertEquals(new FileType(FORMAT_FILE_TYPE_CODE), resultFileType);
    // Verify the external calls.
    verify(fileTypeService).createFileType(fileTypeCreateRequest);
    verifyNoMoreInteractions(fileTypeService);
    // Validate the returned object.
    assertEquals(fileType, resultFileType);
}