Search in sources :

Example 11 with DataBridgeBaseManifestDto

use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.

the class UploaderWebClientTest method testGetBusinessObjectDataUploadCredential2.

@Test
public void testGetBusinessObjectDataUploadCredential2() throws Exception {
    DataBridgeBaseManifestDto manifest = new DataBridgeBaseManifestDto();
    manifest.setNamespace("test1");
    manifest.setBusinessObjectDefinitionName("test2");
    manifest.setBusinessObjectFormatUsage("test3");
    manifest.setBusinessObjectFormatFileType("test4");
    manifest.setBusinessObjectFormatVersion("test5");
    manifest.setPartitionValue("test6");
    String storageName = "test8";
    Integer businessObjectDataVersion = 1234;
    Boolean createNewVersion = null;
    uploaderWebClient.getRegServerAccessParamsDto().setUseSsl(true);
    BusinessObjectDataUploadCredential businessObjectDataUploadCredential = uploaderWebClient.getBusinessObjectDataUploadCredential(manifest, storageName, businessObjectDataVersion, createNewVersion);
    Assert.assertNotNull(businessObjectDataUploadCredential);
    AwsCredential awsCredential = businessObjectDataUploadCredential.getAwsCredential();
    Assert.assertNotNull(awsCredential);
    Assert.assertEquals("https://testWebServiceHostname:1234/herd-app/rest/businessObjectData/upload/credential/namespaces/test1" + "/businessObjectDefinitionNames/test2/businessObjectFormatUsages/test3/businessObjectFormatFileTypes/test4/businessObjectFormatVersions/test5" + "/partitionValues/test6?storageName=test8&businessObjectDataVersion=1234", awsCredential.getAwsAccessKey());
}
Also used : BusinessObjectDataUploadCredential(org.finra.herd.model.api.xml.BusinessObjectDataUploadCredential) DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto) AwsCredential(org.finra.herd.model.api.xml.AwsCredential) Test(org.junit.Test)

Example 12 with DataBridgeBaseManifestDto

use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.

the class UploaderWebClientTest method testGetBusinessObjectDataUploadCredential3.

@Test
public void testGetBusinessObjectDataUploadCredential3() throws Exception {
    DataBridgeBaseManifestDto manifest = new DataBridgeBaseManifestDto();
    manifest.setNamespace("test1");
    manifest.setBusinessObjectDefinitionName("test2");
    manifest.setBusinessObjectFormatUsage("test3");
    manifest.setBusinessObjectFormatFileType("test4");
    manifest.setBusinessObjectFormatVersion("test5");
    manifest.setPartitionValue("test6");
    manifest.setSubPartitionValues(Arrays.asList("test7", "test8"));
    String storageName = "test8";
    Integer businessObjectDataVersion = null;
    Boolean createNewVersion = true;
    uploaderWebClient.getRegServerAccessParamsDto().setUseSsl(true);
    BusinessObjectDataUploadCredential businessObjectDataUploadCredential = uploaderWebClient.getBusinessObjectDataUploadCredential(manifest, storageName, businessObjectDataVersion, createNewVersion);
    Assert.assertNotNull(businessObjectDataUploadCredential);
    AwsCredential awsCredential = businessObjectDataUploadCredential.getAwsCredential();
    Assert.assertNotNull(awsCredential);
    Assert.assertEquals("https://testWebServiceHostname:1234/herd-app/rest/businessObjectData/upload/credential/namespaces/test1" + "/businessObjectDefinitionNames/test2/businessObjectFormatUsages/test3/businessObjectFormatFileTypes/test4/businessObjectFormatVersions/test5" + "/partitionValues/test6?storageName=test8&subPartitionValues=test7%7Ctest8&createNewVersion=true", awsCredential.getAwsAccessKey());
}
Also used : BusinessObjectDataUploadCredential(org.finra.herd.model.api.xml.BusinessObjectDataUploadCredential) DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto) AwsCredential(org.finra.herd.model.api.xml.AwsCredential) Test(org.junit.Test)

Example 13 with DataBridgeBaseManifestDto

use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.

the class DataBridgeControllerTest method testGetStorageNameFromManifestAssertReturnDefaultWhenStorageNull.

/**
 * When manifest does not specify storage name Assert return StorageEntity.MANAGED_STORAGE
 */
@Test
public void testGetStorageNameFromManifestAssertReturnDefaultWhenStorageNull() {
    DataBridgeController dataBridgeController = new BasicDataBridgeController();
    DataBridgeBaseManifestDto manifest = new DataBridgeBaseManifestDto();
    String value = dataBridgeController.getStorageNameFromManifest(manifest);
    assertEquals(StorageEntity.MANAGED_STORAGE, value);
}
Also used : DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto) AbstractCoreTest(org.finra.herd.core.AbstractCoreTest) Test(org.junit.Test)

Example 14 with DataBridgeBaseManifestDto

use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.

the class DataBridgeControllerTest method testGetStorageNameFromManifestAssertReturnDefaultWhenStorageNameBlank.

/**
 * When manifest specifies blank text storage name Assert return StorageEntity.MANAGED_STORAGE
 */
@Test
public void testGetStorageNameFromManifestAssertReturnDefaultWhenStorageNameBlank() {
    DataBridgeController dataBridgeController = new BasicDataBridgeController();
    DataBridgeBaseManifestDto manifest = new DataBridgeBaseManifestDto();
    manifest.setStorageName(BLANK_TEXT);
    String value = dataBridgeController.getStorageNameFromManifest(manifest);
    assertEquals(StorageEntity.MANAGED_STORAGE, value);
}
Also used : DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto) AbstractCoreTest(org.finra.herd.core.AbstractCoreTest) Test(org.junit.Test)

Example 15 with DataBridgeBaseManifestDto

use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.

the class DataBridgeControllerTest method testGetStorageNameFromManifestAssertReturnDefaultWhenStorageNameNull.

/**
 * When manifest specifies null storage name Assert return StorageEntity.MANAGED_STORAGE
 */
@Test
public void testGetStorageNameFromManifestAssertReturnDefaultWhenStorageNameNull() {
    DataBridgeController dataBridgeController = new BasicDataBridgeController();
    DataBridgeBaseManifestDto manifest = new DataBridgeBaseManifestDto();
    manifest.setStorageName(null);
    String value = dataBridgeController.getStorageNameFromManifest(manifest);
    assertEquals(StorageEntity.MANAGED_STORAGE, value);
}
Also used : DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto) AbstractCoreTest(org.finra.herd.core.AbstractCoreTest) Test(org.junit.Test)

Aggregations

DataBridgeBaseManifestDto (org.finra.herd.model.dto.DataBridgeBaseManifestDto)16 Test (org.junit.Test)13 AbstractCoreTest (org.finra.herd.core.AbstractCoreTest)4 AwsCredential (org.finra.herd.model.api.xml.AwsCredential)3 BusinessObjectDataUploadCredential (org.finra.herd.model.api.xml.BusinessObjectDataUploadCredential)3 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 File (java.io.File)1 IOException (java.io.IOException)1 S3KeyPrefixInformation (org.finra.herd.model.api.xml.S3KeyPrefixInformation)1