use of org.finra.herd.model.api.xml.FileTypeKeys in project herd by FINRAOS.
the class FileTypeRestControllerTest method testGetFileTypes.
@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);
}
use of org.finra.herd.model.api.xml.FileTypeKeys in project herd by FINRAOS.
the class FileTypeServiceTest method testGetFileTypes.
@Test
public void testGetFileTypes() throws Exception {
// Create and persist file type entities.
for (FileTypeKey key : fileTypeDaoTestHelper.getTestFileTypeKeys()) {
fileTypeDaoTestHelper.createFileTypeEntity(key.getFileTypeCode());
}
// Retrieve a list of file type keys.
FileTypeKeys resultFileTypeKeys = fileTypeService.getFileTypes();
// Validate the returned object.
assertNotNull(resultFileTypeKeys);
assertTrue(resultFileTypeKeys.getFileTypeKeys().containsAll(fileTypeDaoTestHelper.getTestFileTypeKeys()));
}
use of org.finra.herd.model.api.xml.FileTypeKeys in project herd by FINRAOS.
the class FileTypeServiceImpl method getFileTypes.
@Override
public FileTypeKeys getFileTypes() {
FileTypeKeys fileTypeKeys = new FileTypeKeys();
fileTypeKeys.getFileTypeKeys().addAll(fileTypeDao.getFileTypes());
return fileTypeKeys;
}
Aggregations