use of org.finra.herd.model.api.xml.StoragePlatform in project herd by FINRAOS.
the class StoragePlatformServiceImpl method createStoragePlatformFromEntity.
/**
* Creates a storage platform object from it's entity object.
*
* @param storagePlatformEntity the storage platform entity.
*
* @return the storage platform.
*/
private StoragePlatform createStoragePlatformFromEntity(StoragePlatformEntity storagePlatformEntity) {
StoragePlatform storagePlatform = new StoragePlatform();
storagePlatform.setName(storagePlatformEntity.getName());
return storagePlatform;
}
use of org.finra.herd.model.api.xml.StoragePlatform in project herd by FINRAOS.
the class StoragePlatformRestControllerTest method testGetStoragePlatform.
@Test
public void testGetStoragePlatform() throws Exception {
StoragePlatform storagePlatform = new StoragePlatform(StoragePlatformEntity.S3);
when(storagePlatformService.getStoragePlatform(StoragePlatformEntity.S3)).thenReturn(storagePlatform);
StoragePlatform resultStoragePlatform = storagePlatformRestController.getStoragePlatform(StoragePlatformEntity.S3);
assertNotNull(storagePlatform);
assertTrue(StoragePlatformEntity.S3.equals(storagePlatform.getName()));
logger.info("Storage platform name: " + storagePlatform.getName());
// Verify the external calls.
verify(storagePlatformService).getStoragePlatform(StoragePlatformEntity.S3);
verifyNoMoreInteractions(storagePlatformService);
// Validate the returned object.
assertEquals(storagePlatform, resultStoragePlatform);
}
use of org.finra.herd.model.api.xml.StoragePlatform 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.StoragePlatform in project herd by FINRAOS.
the class StoragePlatformServiceTest method testGetStoragePlatform.
@Test
public void testGetStoragePlatform() throws Exception {
StoragePlatform storagePlatform = storagePlatformService.getStoragePlatform(StoragePlatformEntity.S3);
assertNotNull(storagePlatform);
assertEquals(StoragePlatformEntity.S3, storagePlatform.getName());
}
Aggregations