@Test
public void testCreateFileType()
{

    when(fileTypeMockDao.getFileTypeByCode(FORMAT_FILE_TYPE_CODE)).thenReturn(null);
    when(alternateKeyHelper.validateStringParameter(anyString(), anyString())).thenReturn(FORMAT_FILE_TYPE_CODE);
    when(fileTypeMockDao.saveAndRefresh(any(FileTypeEntity.class))).thenReturn(FILE_TYPE_ENTITY);
    FileType fileType = fileTypeMockService.createFileType(FILE_TYPE_CREATE_REQUEST);
    assertEquals(FORMAT_FILE_TYPE_CODE, fileType.getFileTypeCode());
    verify(alternateKeyHelper).validateStringParameter("file type code", FORMAT_FILE_TYPE_CODE);
    verify(fileTypeMockDao).getFileTypeByCode(FORMAT_FILE_TYPE_CODE);
    verify(fileTypeMockDao).saveAndRefresh(any(FileTypeEntity.class));
    verifyNoMoreInteractionsHelper();
}