use of org.finra.herd.model.dto.UploaderInputManifestDto in project herd by FINRAOS.
the class DataBridgeWebClientTest method testPreRegisterBusinessObjectData.
/**
* Calls preRegisterBusinessObjectData() method and makes assertions.
*
* @param attributes a map of business object data attributes
* @param useSsl specifies whether to use SSL or not
*
* @throws IOException
* @throws JAXBException
* @throws URISyntaxException
*/
private void testPreRegisterBusinessObjectData(HashMap<String, String> attributes, boolean useSsl) throws IOException, JAXBException, URISyntaxException {
dataBridgeWebClient.regServerAccessParamsDto.setUseSsl(useSsl);
UploaderInputManifestDto manifest = getUploaderInputManifestDto();
manifest.setAttributes(attributes);
String storageName = "testStorage";
Boolean createNewVersion = false;
BusinessObjectData businessObjectData = dataBridgeWebClient.preRegisterBusinessObjectData(manifest, storageName, createNewVersion);
assertNotNull("businessObjectData", businessObjectData);
}
use of org.finra.herd.model.dto.UploaderInputManifestDto in project herd by FINRAOS.
the class DataBridgeWebClientTest method testAddStorageFiles.
/**
* Calls addStorageFiles() method and makes assertions.
*
* @param useSsl specifies whether to use SSL or not
*
* @throws IOException
* @throws JAXBException
* @throws URISyntaxException
*/
private void testAddStorageFiles(boolean useSsl) throws IOException, JAXBException, URISyntaxException {
dataBridgeWebClient.regServerAccessParamsDto.setUseSsl(useSsl);
BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey();
UploaderInputManifestDto manifest = getUploaderInputManifestDto();
S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto = new S3FileTransferRequestParamsDto();
String storageName = "testStorage";
BusinessObjectDataStorageFilesCreateResponse businessObjectDataStorageFilesCreateResponse = dataBridgeWebClient.addStorageFiles(businessObjectDataKey, manifest, s3FileTransferRequestParamsDto, storageName);
assertNotNull("businessObjectDataStorageFilesCreateResponse", businessObjectDataStorageFilesCreateResponse);
}
use of org.finra.herd.model.dto.UploaderInputManifestDto in project herd by FINRAOS.
the class DataBridgeWebClientTest method getUploaderInputManifestDto.
/**
* Creates a UploaderInputManifestDto.
*
* @return the created UploaderInputManifestDto instance
*/
private UploaderInputManifestDto getUploaderInputManifestDto() {
UploaderInputManifestDto manifest = new UploaderInputManifestDto();
manifest.setNamespace("testNamespace");
manifest.setBusinessObjectDefinitionName("testBusinessObjectDefinitionName");
manifest.setBusinessObjectFormatUsage("testBusinessObjectFormatUsage");
manifest.setBusinessObjectFormatFileType("testBusinessObjectFormatFileType");
manifest.setBusinessObjectFormatVersion("0");
manifest.setPartitionKey("testPartitionKey");
manifest.setPartitionValue("testPartitionValue");
manifest.setSubPartitionValues(Arrays.asList("testSubPartitionValue1", "testSubPartitionValue2"));
List<ManifestFile> manifestFiles = new ArrayList<>();
{
ManifestFile manifestFile = new ManifestFile();
manifestFile.setFileName("testFileName");
manifestFile.setFileSizeBytes(1l);
manifestFile.setRowCount(2l);
manifestFiles.add(manifestFile);
}
manifest.setManifestFiles(manifestFiles);
HashMap<String, String> attributes = new HashMap<>();
{
attributes.put("testName", "testValue");
}
manifest.setAttributes(attributes);
return manifest;
}
use of org.finra.herd.model.dto.UploaderInputManifestDto in project herd by FINRAOS.
the class UploaderManifestReaderTest method testReadJsonManifestEmptyParentsList.
@Test
public void testReadJsonManifestEmptyParentsList() throws IOException {
// Create and read the uploaderInputManifestDto file with an empty list of parents.
UploaderInputManifestDto uploaderInputManifestDto = getTestUploaderInputManifestDto();
uploaderInputManifestDto.setBusinessObjectDataParents(new ArrayList<BusinessObjectDataKey>());
UploaderInputManifestDto resultManifest = uploaderManifestReader.readJsonManifest(createManifestFile(LOCAL_TEMP_PATH_INPUT.toString(), uploaderInputManifestDto));
// Validate the results.
assertUploaderManifest(uploaderInputManifestDto, resultManifest);
}
use of org.finra.herd.model.dto.UploaderInputManifestDto in project herd by FINRAOS.
the class UploaderManifestReaderTest method testReadJsonManifestMaxAttributeValueLength.
@Test
public void testReadJsonManifestMaxAttributeValueLength() throws IOException {
UploaderInputManifestDto uploaderInputManifestDto = getTestUploaderInputManifestDto();
HashMap<String, String> attributes = new HashMap<>();
uploaderInputManifestDto.setAttributes(attributes);
String attributeKey = ATTRIBUTE_NAME_1_MIXED_CASE;
// Returns "*...*value"
String attributeValue = StringUtils.leftPad("value", UploaderManifestReader.MAX_ATTRIBUTE_VALUE_LENGTH, '*');
assertTrue(attributeValue.length() == UploaderManifestReader.MAX_ATTRIBUTE_VALUE_LENGTH);
attributes.put(attributeKey, attributeValue);
UploaderInputManifestDto resultManifest = uploaderManifestReader.readJsonManifest(createManifestFile(LOCAL_TEMP_PATH_INPUT.toString(), uploaderInputManifestDto));
// Validate the results.
assertUploaderManifest(uploaderInputManifestDto, resultManifest);
}
Aggregations