use of org.finra.herd.model.api.xml.StorageKey in project herd by FINRAOS.
the class StorageServiceTest method testUpdateStorageAttributesRemoveAllAttributes.
@Test
public void testUpdateStorageAttributesRemoveAllAttributes() {
// Create and persist a valid storage.
StorageCreateRequest request = getNewStorageCreateRequest();
Storage storage = storageService.createStorage(request);
// Update attributes for the storage.
Storage result = storageService.updateStorageAttributes(new StorageKey(storage.getName()), new StorageAttributesUpdateRequest(NO_ATTRIBUTES));
// Validate the results.
assertEquals(new Storage(storage.getName(), storage.getStoragePlatformName(), NO_ATTRIBUTES), result);
}
use of org.finra.herd.model.api.xml.StorageKey in project herd by FINRAOS.
the class StorageServiceTest method testUpdateStorage.
@Test
public void testUpdateStorage() {
// Create a storage.
Storage storage = storageService.createStorage(getNewStorageCreateRequest());
// Update the storage.
// TODO: Update various attributes of the storage update request in the future when there is something to update.
Storage result = storageService.updateStorage(new StorageKey(storage.getName()), new StorageUpdateRequest());
// Validate the results.
// TODO: Add asserts to ensure fields that were update indeed got updated.
assertEquals(new Storage(storage.getName(), storage.getStoragePlatformName(), storage.getAttributes()), result);
}
use of org.finra.herd.model.api.xml.StorageKey in project herd by FINRAOS.
the class StorageServiceTest method testUpdateStorageStorageNoExists.
@Test
public void testUpdateStorageStorageNoExists() {
// Try to update a storage that doesn't yet exist.
try {
storageService.updateStorage(new StorageKey(INVALID_VALUE), new StorageUpdateRequest());
fail();
} catch (ObjectNotFoundException e) {
assertEquals(String.format("Storage with name \"%s\" doesn't exist.", INVALID_VALUE), e.getMessage());
}
}
use of org.finra.herd.model.api.xml.StorageKey in project herd by FINRAOS.
the class StorageServiceTest method testGetStorage.
@Test
public void testGetStorage() {
// Create and persist a valid storage.
Storage storage = storageService.createStorage(getNewStorageCreateRequest());
// Retrieve the storage by its name.
Storage result = storageService.getStorage(new StorageKey(storage.getName()));
// Validate the results.
assertEquals(storage, result);
}
use of org.finra.herd.model.api.xml.StorageKey in project herd by FINRAOS.
the class StorageServiceTest method testDeleteStorage.
@Test
public void testDeleteStorage() {
// Create and persist a valid storage.
Storage storage = storageService.createStorage(getNewStorageCreateRequest());
// Delete the storage.
Storage result = storageService.deleteStorage(new StorageKey(storage.getName()));
assertEquals(storage, result);
// Retrieve the storage by its name and verify that it doesn't exist.
assertNull(storageDao.getStorageByName(storage.getName()));
}
Aggregations