Search in sources :

Example 11 with Storage

use of org.finra.herd.model.api.xml.Storage in project herd by FINRAOS.

the class StorageServiceTest method testUpdateStorageAttributes.

@Test
public void testUpdateStorageAttributes() {
    // 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(businessObjectDefinitionServiceTestHelper.getNewAttributes2()));
    // Validate the results.
    assertEquals(new Storage(storage.getName(), storage.getStoragePlatformName(), businessObjectDefinitionServiceTestHelper.getNewAttributes2()), result);
}
Also used : Storage(org.finra.herd.model.api.xml.Storage) StorageAttributesUpdateRequest(org.finra.herd.model.api.xml.StorageAttributesUpdateRequest) StorageCreateRequest(org.finra.herd.model.api.xml.StorageCreateRequest) StorageKey(org.finra.herd.model.api.xml.StorageKey) Test(org.junit.Test)

Example 12 with Storage

use of org.finra.herd.model.api.xml.Storage 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);
}
Also used : Storage(org.finra.herd.model.api.xml.Storage) StorageAttributesUpdateRequest(org.finra.herd.model.api.xml.StorageAttributesUpdateRequest) StorageCreateRequest(org.finra.herd.model.api.xml.StorageCreateRequest) StorageKey(org.finra.herd.model.api.xml.StorageKey) Test(org.junit.Test)

Example 13 with Storage

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

Example 14 with Storage

use of org.finra.herd.model.api.xml.Storage in project herd by FINRAOS.

the class StorageServiceTest method testCreateStorage.

@Test
public void testCreateStorage() {
    // Create and persist a valid storage.
    StorageCreateRequest request = getNewStorageCreateRequest();
    Storage result = storageService.createStorage(request);
    // Validate the results.
    assertEquals(new Storage(request.getName(), request.getStoragePlatformName(), request.getAttributes()), result);
}
Also used : Storage(org.finra.herd.model.api.xml.Storage) StorageCreateRequest(org.finra.herd.model.api.xml.StorageCreateRequest) Test(org.junit.Test)

Example 15 with Storage

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

Aggregations

Storage (org.finra.herd.model.api.xml.Storage)38 Test (org.junit.Test)29 StorageUnit (org.finra.herd.model.api.xml.StorageUnit)19 BusinessObjectData (org.finra.herd.model.api.xml.BusinessObjectData)17 Attribute (org.finra.herd.model.api.xml.Attribute)10 StorageKey (org.finra.herd.model.api.xml.StorageKey)10 ArrayList (java.util.ArrayList)6 StorageCreateRequest (org.finra.herd.model.api.xml.StorageCreateRequest)6 File (java.io.File)5 BusinessObjectDataKey (org.finra.herd.model.api.xml.BusinessObjectDataKey)4 S3KeyPrefixInformation (org.finra.herd.model.api.xml.S3KeyPrefixInformation)4 StorageAttributesUpdateRequest (org.finra.herd.model.api.xml.StorageAttributesUpdateRequest)4 StorageDirectory (org.finra.herd.model.api.xml.StorageDirectory)4 DownloaderInputManifestDto (org.finra.herd.model.dto.DownloaderInputManifestDto)4 DownloaderOutputManifestDto (org.finra.herd.model.dto.DownloaderOutputManifestDto)4 StorageUnitEntity (org.finra.herd.model.jpa.StorageUnitEntity)4 IOException (java.io.IOException)3 Path (java.nio.file.Path)3 AwsCredential (org.finra.herd.model.api.xml.AwsCredential)3 BusinessObjectDataStorageUnitKey (org.finra.herd.model.api.xml.BusinessObjectDataStorageUnitKey)3