Search in sources :

Example 1 with StoragePlatform

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

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

Example 3 with StoragePlatform

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

Example 4 with StoragePlatform

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

Aggregations

StoragePlatform (org.finra.herd.model.api.xml.StoragePlatform)4 Test (org.junit.Test)3 StoragePlatforms (org.finra.herd.model.api.xml.StoragePlatforms)1