use of org.finra.herd.model.api.xml.StorageKeys in project herd by FINRAOS.
the class StorageRestControllerTest method testGetStorages.
@Test
public void testGetStorages() {
// Get a list of storage keys.
StorageKeys storageKeys = new StorageKeys(Arrays.asList(new StorageKey(STORAGE_NAME), new StorageKey(STORAGE_NAME_2)));
// Mock the external calls.
when(storageService.getAllStorage()).thenReturn(storageKeys);
// Call the method under test.
StorageKeys result = storageRestController.getStorages();
// Verify the external calls.
verify(storageService).getAllStorage();
verifyNoMoreInteractions(storageService);
// Validate the returned object.
assertEquals(storageKeys, result);
}
use of org.finra.herd.model.api.xml.StorageKeys in project herd by FINRAOS.
the class StorageServiceTest method testGetAllStorage.
@Test
public void testGetAllStorage() {
// Get a list of test storage keys.
List<StorageKey> storageKeys = storageDaoTestHelper.getTestStorageKeys();
// Create and persist test storage entities.
for (StorageKey storageKey : storageKeys) {
storageDaoTestHelper.createStorageEntity(storageKey.getStorageName());
}
// Retrieve a list of storage keys.
StorageKeys result = storageService.getAllStorage();
// Validate the results.
assertNotNull(result);
assertTrue(result.getStorageKeys().containsAll(storageKeys));
}
use of org.finra.herd.model.api.xml.StorageKeys in project herd by FINRAOS.
the class StorageServiceImpl method getAllStorage.
@Override
public StorageKeys getAllStorage() {
StorageKeys storageKeys = new StorageKeys();
storageKeys.getStorageKeys().addAll(storageDao.getAllStorage());
return storageKeys;
}
Aggregations