Search in sources :

Example 1 with DataBridgeBaseManifestDto

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

the class DataBridgeControllerTest method testGetStorageNameFromManifestAssertReturnStorageName.

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

Example 2 with DataBridgeBaseManifestDto

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

the class DataBridgeWebClientTest method testGetS3KeyPrefix.

/**
 * Calls getS3KeyPrefix() method and makes assertions.
 *
 * @param namespace the namespace
 * @param subPartitionValues the list of sub-partition values
 * @param businessObjectDataVersion the version of the business object data, may be null
 * @param useSsl specifies whether to use SSL or not
 *
 * @throws Exception
 */
private void testGetS3KeyPrefix(String namespace, List<String> subPartitionValues, Integer businessObjectDataVersion, String storageName, boolean useSsl) throws Exception {
    dataBridgeWebClient.regServerAccessParamsDto.setUseSsl(useSsl);
    DataBridgeBaseManifestDto manifest = getUploaderInputManifestDto();
    manifest.setNamespace(namespace);
    manifest.setSubPartitionValues(subPartitionValues);
    manifest.setStorageName(storageName);
    Boolean createNewVersion = false;
    S3KeyPrefixInformation s3KeyPrefix = dataBridgeWebClient.getS3KeyPrefix(manifest, businessObjectDataVersion, createNewVersion);
    assertNotNull("s3KeyPrefix is null", s3KeyPrefix);
}
Also used : S3KeyPrefixInformation(org.finra.herd.model.api.xml.S3KeyPrefixInformation) DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto)

Example 3 with DataBridgeBaseManifestDto

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

the class DataBridgeManifestReaderTest method testReadJsonManifest.

@Test
public void testReadJsonManifest() throws Exception {
    DataBridgeBaseManifestDto dataBridgeBaseManifestDto = getDataBridgeBaseManifestDto();
    File file = createTempFile(new ObjectMapper().writeValueAsString(dataBridgeBaseManifestDto));
    try {
        dataBridgeManifestReader.readJsonManifest(file);
    } catch (Exception e) {
        Assert.fail("unexpected exception was thrown " + e);
    }
}
Also used : DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto) File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) IOException(java.io.IOException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) Test(org.junit.Test)

Example 4 with DataBridgeBaseManifestDto

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

the class DataBridgeManifestReaderTest method testReadJsonManifestNoPartitionKey.

@Test
public void testReadJsonManifestNoPartitionKey() throws Exception {
    DataBridgeBaseManifestDto dataBridgeBaseManifestDto = getDataBridgeBaseManifestDto();
    dataBridgeBaseManifestDto.setPartitionKey(null);
    testReadJsonManifest(dataBridgeBaseManifestDto, "Manifest business object format partition key must be specified.");
}
Also used : DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto) Test(org.junit.Test)

Example 5 with DataBridgeBaseManifestDto

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

the class DataBridgeManifestReaderTest method testReadJsonManifestNoDefinitionName.

@Test
public void testReadJsonManifestNoDefinitionName() throws Exception {
    DataBridgeBaseManifestDto dataBridgeBaseManifestDto = getDataBridgeBaseManifestDto();
    dataBridgeBaseManifestDto.setBusinessObjectDefinitionName(null);
    testReadJsonManifest(dataBridgeBaseManifestDto, "Manifest business object definition name must be specified.");
}
Also used : DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto) 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