use of org.finra.herd.model.dto.UploaderInputManifestDto in project herd by FINRAOS.
the class UploaderManifestReaderTest method testReadJsonManifestMaxAttributeNameLength.
@Test
public void testReadJsonManifestMaxAttributeNameLength() throws IOException {
UploaderInputManifestDto uploaderInputManifestDto = getTestUploaderInputManifestDto();
HashMap<String, String> attributes = new HashMap<>();
uploaderInputManifestDto.setAttributes(attributes);
// Returns "*...*key"
String attributeKey = StringUtils.leftPad("key", UploaderManifestReader.MAX_ATTRIBUTE_NAME_LENGTH, '*');
assertTrue(attributeKey.length() == UploaderManifestReader.MAX_ATTRIBUTE_NAME_LENGTH);
attributes.put(attributeKey, ATTRIBUTE_VALUE_1);
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 testReadJsonManifest.
@Test
public void testReadJsonManifest() throws IOException {
// Create and read an uploaderInputManifestDto file.
UploaderInputManifestDto resultManifest = uploaderManifestReader.readJsonManifest(createManifestFile(LOCAL_TEMP_PATH_INPUT.toString(), getTestUploaderInputManifestDto()));
// Validate the results.
assertUploaderManifest(getTestUploaderInputManifestDto(), resultManifest);
}
use of org.finra.herd.model.dto.UploaderInputManifestDto in project herd by FINRAOS.
the class DownloaderWebClientTest method testGetData.
@Test
public void testGetData() throws Exception {
// Upload and register business object data parents.
uploadAndRegisterTestDataParents(downloaderWebClient);
// Upload and register the initial version if of the test business object data.
uploadTestDataFilesToS3(S3_TEST_PATH_V0);
final UploaderInputManifestDto uploaderInputManifestDto = getTestUploaderInputManifestDto();
executeWithoutLogging(DataBridgeWebClient.class, new Command() {
@Override
public void execute() throws Exception {
BusinessObjectData businessObjectData = downloaderWebClient.preRegisterBusinessObjectData(uploaderInputManifestDto, StorageEntity.MANAGED_STORAGE, false);
BusinessObjectDataKey businessObjectDataKey = businessObjectDataHelper.getBusinessObjectDataKey(businessObjectData);
downloaderWebClient.addStorageFiles(businessObjectDataKey, uploaderInputManifestDto, getTestS3FileTransferRequestParamsDto(S3_TEST_PATH_V0 + "/"), StorageEntity.MANAGED_STORAGE);
downloaderWebClient.updateBusinessObjectDataStatus(businessObjectDataKey, BusinessObjectDataStatusEntity.VALID);
}
});
// Get business object data information.
DownloaderInputManifestDto downloaderInputManifestDto = getTestDownloaderInputManifestDto();
BusinessObjectData resultBusinessObjectData = downloaderWebClient.getBusinessObjectData(downloaderInputManifestDto);
// Validate the results.
assertNotNull(resultBusinessObjectData);
}
Aggregations