Search in sources :

Example 1 with StoragePlatforms

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

Example 2 with 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);
}
Also used : StoragePlatform(org.finra.herd.model.api.xml.StoragePlatform) StoragePlatforms(org.finra.herd.model.api.xml.StoragePlatforms) Test(org.junit.Test)

Example 3 with StoragePlatforms

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

Aggregations

StoragePlatforms (org.finra.herd.model.api.xml.StoragePlatforms)3 Test (org.junit.Test)2 StoragePlatform (org.finra.herd.model.api.xml.StoragePlatform)1 StoragePlatformEntity (org.finra.herd.model.jpa.StoragePlatformEntity)1