Search in sources :

Example 1 with FileTypeKeys

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);
}
Also used : FileTypeKey(org.finra.herd.model.api.xml.FileTypeKey) FileTypeKeys(org.finra.herd.model.api.xml.FileTypeKeys) Test(org.junit.Test)

Example 2 with FileTypeKeys

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()));
}
Also used : FileTypeKey(org.finra.herd.model.api.xml.FileTypeKey) FileTypeKeys(org.finra.herd.model.api.xml.FileTypeKeys) Test(org.junit.Test)

Example 3 with FileTypeKeys

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;
}
Also used : FileTypeKeys(org.finra.herd.model.api.xml.FileTypeKeys)

Aggregations

FileTypeKeys (org.finra.herd.model.api.xml.FileTypeKeys)3 FileTypeKey (org.finra.herd.model.api.xml.FileTypeKey)2 Test (org.junit.Test)2