test_class.declarator: FILE_TYPE_CODE_WITH_EXTRA_SPACES = FORMAT_FILE_TYPE_CODE + "    "
test_class.modifier: private static final
test_class.original_string: private static final String FILE_TYPE_CODE_WITH_EXTRA_SPACES = FORMAT_FILE_TYPE_CODE + "    ";
test_class.type: String
test_class.var_name: FILE_TYPE_CODE_WITH_EXTRA_SPACES
test_class.declarator: FILE_TYPE_CREATE_REQUEST = new FileTypeCreateRequest()
      {{
          setFileTypeCode(FORMAT_FILE_TYPE_CODE);
      }}
test_class.modifier: private static final
test_class.original_string: private static final FileTypeCreateRequest FILE_TYPE_CREATE_REQUEST = new FileTypeCreateRequest()
      {{
          setFileTypeCode(FORMAT_FILE_TYPE_CODE);
      }};
test_class.type: FileTypeCreateRequest
test_class.var_name: FILE_TYPE_CREATE_REQUEST
test_class.declarator: FILE_TYPE_CREATE_REQUEST_WITH_EXTRA_SPACES_IN_NAME = new FileTypeCreateRequest()
      {{
          setFileTypeCode(FILE_TYPE_CODE_WITH_EXTRA_SPACES);
      }}
test_class.modifier: private static final
test_class.original_string: private static final FileTypeCreateRequest FILE_TYPE_CREATE_REQUEST_WITH_EXTRA_SPACES_IN_NAME = new FileTypeCreateRequest()
      {{
          setFileTypeCode(FILE_TYPE_CODE_WITH_EXTRA_SPACES);
      }};
test_class.type: FileTypeCreateRequest
test_class.var_name: FILE_TYPE_CREATE_REQUEST_WITH_EXTRA_SPACES_IN_NAME
test_class.declarator: FILE_TYPE_KEY = new FileTypeKey()
      {{
          setFileTypeCode(FORMAT_FILE_TYPE_CODE);
      }}
test_class.modifier: private static final
test_class.original_string: private static final FileTypeKey FILE_TYPE_KEY = new FileTypeKey()
      {{
          setFileTypeCode(FORMAT_FILE_TYPE_CODE);
      }};
test_class.type: FileTypeKey
test_class.var_name: FILE_TYPE_KEY
test_class.declarator: FILE_TYPE_KEY_WITH_EXTRA_SPACES_IN_NAME = new FileTypeKey()
      {{
          setFileTypeCode(FILE_TYPE_CODE_WITH_EXTRA_SPACES);
      }}
test_class.modifier: private static final
test_class.original_string: private static final FileTypeKey FILE_TYPE_KEY_WITH_EXTRA_SPACES_IN_NAME = new FileTypeKey()
      {{
          setFileTypeCode(FILE_TYPE_CODE_WITH_EXTRA_SPACES);
      }};
test_class.type: FileTypeKey
test_class.var_name: FILE_TYPE_KEY_WITH_EXTRA_SPACES_IN_NAME
test_class.declarator: FILE_TYPE_ENTITY = new FileTypeEntity()
      {{
          setCode(FORMAT_FILE_TYPE_CODE);
          setCreatedBy(CREATED_BY);
          setUpdatedBy(CREATED_BY);
          setCreatedOn(new Timestamp(CREATED_ON.getMillisecond()));
      }}
test_class.modifier: private static final
test_class.original_string: private static final FileTypeEntity FILE_TYPE_ENTITY = new FileTypeEntity()
      {{
          setCode(FORMAT_FILE_TYPE_CODE);
          setCreatedBy(CREATED_BY);
          setUpdatedBy(CREATED_BY);
          setCreatedOn(new Timestamp(CREATED_ON.getMillisecond()));
      }};
test_class.type: FileTypeEntity
test_class.var_name: FILE_TYPE_ENTITY
test_class.declarator: ALL_FILE_TYPE_KEYS = Arrays.asList(new FileTypeKey()
          {{
              setFileTypeCode(FORMAT_FILE_TYPE_CODE);
          }},
  
          new FileTypeKey()
          {{
              setFileTypeCode(FORMAT_FILE_TYPE_CODE_2);
          }},
  
          new FileTypeKey()
          {{
              setFileTypeCode(FORMAT_FILE_TYPE_CODE_3);
          }})
test_class.modifier: private static final
test_class.original_string: private static final List<FileTypeKey> ALL_FILE_TYPE_KEYS = Arrays.asList(new FileTypeKey()
          {{
              setFileTypeCode(FORMAT_FILE_TYPE_CODE);
          }},
  
          new FileTypeKey()
          {{
              setFileTypeCode(FORMAT_FILE_TYPE_CODE_2);
          }},
  
          new FileTypeKey()
          {{
              setFileTypeCode(FORMAT_FILE_TYPE_CODE_3);
          }});
test_class.type: List<FileTypeKey>
test_class.var_name: ALL_FILE_TYPE_KEYS
test_class.declarator: fileTypeMockService
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private FileTypeServiceImpl fileTypeMockService;
test_class.type: FileTypeServiceImpl
test_class.var_name: fileTypeMockService
test_class.declarator: alternateKeyHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AlternateKeyHelper alternateKeyHelper;
test_class.type: AlternateKeyHelper
test_class.var_name: alternateKeyHelper
test_class.declarator: fileTypeMockDao
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private FileTypeDao fileTypeMockDao;
test_class.type: FileTypeDao
test_class.var_name: fileTypeMockDao
test_class.declarator: fileTypeDaoHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private FileTypeDaoHelper fileTypeDaoHelper;
test_class.type: FileTypeDaoHelper
test_class.var_name: fileTypeDaoHelper
test_class.declarator: expectedException = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException expectedException = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedException
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/impl/FileTypeServiceImplTest.java
test_class.identifier: FileTypeServiceImplTest
test_case.body: @Test
      public void testCreateFileTypeAlreadyExists()
      {
          expectedException.expect(AlreadyExistsException.class);
          expectedException.expectMessage(String.format("Unable to create file type \"%s\" because it already exists.", FORMAT_FILE_TYPE_CODE));
  
          when(fileTypeMockDao.getFileTypeByCode(FORMAT_FILE_TYPE_CODE)).thenReturn(FILE_TYPE_ENTITY);
          when(alternateKeyHelper.validateStringParameter(anyString(), anyString())).thenReturn(FORMAT_FILE_TYPE_CODE);
          fileTypeMockService.createFileType(FILE_TYPE_CREATE_REQUEST);
      }
test_case.class_method_signature: FileTypeServiceImplTest.testCreateFileTypeAlreadyExists()
test_case.full_signature: @Test public void testCreateFileTypeAlreadyExists()
test_case.identifier: testCreateFileTypeAlreadyExists
test_case.invocations: expect expectMessage format thenReturn when getFileTypeByCode thenReturn when validateStringParameter anyString anyString createFileType
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateFileTypeAlreadyExists()
focal_class.declarator: alternateKeyHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private AlternateKeyHelper alternateKeyHelper;
focal_class.type: AlternateKeyHelper
focal_class.var_name: alternateKeyHelper
focal_class.declarator: fileTypeDaoHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private FileTypeDaoHelper fileTypeDaoHelper;
focal_class.type: FileTypeDaoHelper
focal_class.var_name: fileTypeDaoHelper
focal_class.declarator: fileTypeDao
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private FileTypeDao fileTypeDao;
focal_class.type: FileTypeDao
focal_class.var_name: fileTypeDao
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/impl/FileTypeServiceImpl.java
focal_class.identifier: FileTypeServiceImpl
focal_class.interfaces: implements FileTypeService
focal_class.class_method_signature: FileTypeServiceImpl.createFileType(FileTypeCreateRequest fileTypeCreateRequest)
focal_class.full_signature: @Override public FileType createFileType(FileTypeCreateRequest fileTypeCreateRequest)
focal_class.identifier: createFileType
focal_class.modifiers: @Override public
focal_class.parameters: (FileTypeCreateRequest fileTypeCreateRequest)
focal_class.return: FileType
focal_class.signature: FileType createFileType(FileTypeCreateRequest fileTypeCreateRequest)
focal_class.class_method_signature: FileTypeServiceImpl.getFileType(FileTypeKey fileTypeKey)
focal_class.full_signature: @Override public FileType getFileType(FileTypeKey fileTypeKey)
focal_class.identifier: getFileType
focal_class.modifiers: @Override public
focal_class.parameters: (FileTypeKey fileTypeKey)
focal_class.return: FileType
focal_class.signature: FileType getFileType(FileTypeKey fileTypeKey)
focal_class.class_method_signature: FileTypeServiceImpl.deleteFileType(FileTypeKey fileTypeKey)
focal_class.full_signature: @Override public FileType deleteFileType(FileTypeKey fileTypeKey)
focal_class.identifier: deleteFileType
focal_class.modifiers: @Override public
focal_class.parameters: (FileTypeKey fileTypeKey)
focal_class.return: FileType
focal_class.signature: FileType deleteFileType(FileTypeKey fileTypeKey)
focal_class.class_method_signature: FileTypeServiceImpl.getFileTypes()
focal_class.full_signature: @Override public FileTypeKeys getFileTypes()
focal_class.identifier: getFileTypes
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: FileTypeKeys
focal_class.signature: FileTypeKeys getFileTypes()
focal_class.class_method_signature: FileTypeServiceImpl.validateFileTypeCreateRequest(FileTypeCreateRequest request)
focal_class.full_signature:  void validateFileTypeCreateRequest(FileTypeCreateRequest request)
focal_class.identifier: validateFileTypeCreateRequest
focal_class.parameters: (FileTypeCreateRequest request)
focal_class.return: void
focal_class.signature: void validateFileTypeCreateRequest(FileTypeCreateRequest request)
focal_class.class_method_signature: FileTypeServiceImpl.validateAndTrimFileTypeKey(FileTypeKey fileTypeKey)
focal_class.full_signature:  void validateAndTrimFileTypeKey(FileTypeKey fileTypeKey)
focal_class.identifier: validateAndTrimFileTypeKey
focal_class.parameters: (FileTypeKey fileTypeKey)
focal_class.return: void
focal_class.signature: void validateAndTrimFileTypeKey(FileTypeKey fileTypeKey)
focal_class.class_method_signature: FileTypeServiceImpl.createFileTypeEntity(FileTypeCreateRequest request)
focal_class.full_signature: private FileTypeEntity createFileTypeEntity(FileTypeCreateRequest request)
focal_class.identifier: createFileTypeEntity
focal_class.modifiers: private
focal_class.parameters: (FileTypeCreateRequest request)
focal_class.return: FileTypeEntity
focal_class.signature: FileTypeEntity createFileTypeEntity(FileTypeCreateRequest request)
focal_class.class_method_signature: FileTypeServiceImpl.createFileTypeFromEntity(FileTypeEntity fileTypeEntity)
focal_class.full_signature: private FileType createFileTypeFromEntity(FileTypeEntity fileTypeEntity)
focal_class.identifier: createFileTypeFromEntity
focal_class.modifiers: private
focal_class.parameters: (FileTypeEntity fileTypeEntity)
focal_class.return: FileType
focal_class.signature: FileType createFileTypeFromEntity(FileTypeEntity fileTypeEntity)
focal_method.body: @Override
      public FileType createFileType(FileTypeCreateRequest fileTypeCreateRequest)
      {
          // Perform the validation.
          validateFileTypeCreateRequest(fileTypeCreateRequest);
  
          // Ensure a file type with the specified file type code doesn't already exist.
          FileTypeEntity fileTypeEntity = fileTypeDao.getFileTypeByCode(fileTypeCreateRequest.getFileTypeCode());
          if (fileTypeEntity != null)
          {
              throw new AlreadyExistsException(
                  String.format("Unable to create file type \"%s\" because it already exists.", fileTypeCreateRequest.getFileTypeCode()));
          }
  
          // Create a file type entity from the request information.
          fileTypeEntity = createFileTypeEntity(fileTypeCreateRequest);
  
          // Persist the new entity.
          fileTypeEntity = fileTypeDao.saveAndRefresh(fileTypeEntity);
  
          // Create and return the file type object from the persisted entity.
          return createFileTypeFromEntity(fileTypeEntity);
      }
focal_method.class_method_signature: FileTypeServiceImpl.createFileType(FileTypeCreateRequest fileTypeCreateRequest)
focal_method.full_signature: @Override public FileType createFileType(FileTypeCreateRequest fileTypeCreateRequest)
focal_method.identifier: createFileType
focal_method.invocations: validateFileTypeCreateRequest getFileTypeByCode getFileTypeCode format getFileTypeCode createFileTypeEntity saveAndRefresh createFileTypeFromEntity
focal_method.modifiers: @Override public
focal_method.parameters: (FileTypeCreateRequest fileTypeCreateRequest)
focal_method.return: FileType
focal_method.signature: FileType createFileType(FileTypeCreateRequest fileTypeCreateRequest)