use of org.finra.herd.model.api.xml.StoragePlatforms in project herd by FINRAOS.
the class StoragePlatformServiceImpl method getStoragePlatforms.
/**
* Gets a list of storage platforms.
*
* @return the list of storage platforms.
*/
@Override
public StoragePlatforms getStoragePlatforms() {
List<StoragePlatformEntity> storagePlatformEntities = storagePlatformDao.findAll(StoragePlatformEntity.class);
StoragePlatforms storagePlatforms = new StoragePlatforms();
for (StoragePlatformEntity storagePlatformEntity : storagePlatformEntities) {
storagePlatforms.getStoragePlatforms().add(createStoragePlatformFromEntity(storagePlatformEntity));
}
return storagePlatforms;
}
use of org.finra.herd.model.api.xml.StoragePlatforms in project herd by FINRAOS.
the class StoragePlatformRestControllerTest method testGetStoragePlatforms.
@Test
public void testGetStoragePlatforms() throws Exception {
StoragePlatforms storagePlatforms = new StoragePlatforms(Arrays.asList(new StoragePlatform()));
when(storagePlatformService.getStoragePlatforms()).thenReturn(storagePlatforms);
StoragePlatforms resultStoragePlatforms = storagePlatformRestController.getStoragePlatforms();
assertNotNull(storagePlatforms);
logger.info("Total number of storage platforms: " + storagePlatforms.getStoragePlatforms().size());
// We should have at least 1 row of reference data present (i.e. S3).
assertTrue(storagePlatforms.getStoragePlatforms().size() >= 1);
// Verify the external calls.
verify(storagePlatformService).getStoragePlatforms();
verifyNoMoreInteractions(storagePlatformService);
// Validate the returned object.
assertEquals(storagePlatforms, resultStoragePlatforms);
}
use of org.finra.herd.model.api.xml.StoragePlatforms in project herd by FINRAOS.
the class StoragePlatformServiceTest method testGetStoragePlatforms.
@Test
public void testGetStoragePlatforms() throws Exception {
StoragePlatforms storagePlatforms = storagePlatformService.getStoragePlatforms();
assertNotNull(storagePlatforms);
// We should have at least 1 row of reference data present (i.e. S3).
assertTrue(storagePlatforms.getStoragePlatforms().size() >= 1);
}
Aggregations