Search in sources :

Example 26 with UploaderInputManifestDto

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);
}
Also used : UploaderInputManifestDto(org.finra.herd.model.dto.UploaderInputManifestDto) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 27 with UploaderInputManifestDto

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);
}
Also used : UploaderInputManifestDto(org.finra.herd.model.dto.UploaderInputManifestDto) Test(org.junit.Test)

Example 28 with UploaderInputManifestDto

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);
}
Also used : UploaderInputManifestDto(org.finra.herd.model.dto.UploaderInputManifestDto) Command(org.finra.herd.core.Command) BusinessObjectData(org.finra.herd.model.api.xml.BusinessObjectData) DownloaderInputManifestDto(org.finra.herd.model.dto.DownloaderInputManifestDto) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

UploaderInputManifestDto (org.finra.herd.model.dto.UploaderInputManifestDto)28 Test (org.junit.Test)20 HashMap (java.util.HashMap)9 BusinessObjectDataKey (org.finra.herd.model.api.xml.BusinessObjectDataKey)9 ManifestFile (org.finra.herd.model.dto.ManifestFile)7 BusinessObjectData (org.finra.herd.model.api.xml.BusinessObjectData)6 S3FileTransferRequestParamsDto (org.finra.herd.model.dto.S3FileTransferRequestParamsDto)5 File (java.io.File)4 IOException (java.io.IOException)3 RegServerAccessParamsDto (org.finra.herd.model.dto.RegServerAccessParamsDto)3 ArrayList (java.util.ArrayList)2 Command (org.finra.herd.core.Command)2 BusinessObjectDataStorageFilesCreateResponse (org.finra.herd.model.api.xml.BusinessObjectDataStorageFilesCreateResponse)2 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 URISyntaxException (java.net.URISyntaxException)1 JAXBException (javax.xml.bind.JAXBException)1 Attribute (org.finra.herd.model.api.xml.Attribute)1 AwsCredential (org.finra.herd.model.api.xml.AwsCredential)1 S3KeyPrefixInformation (org.finra.herd.model.api.xml.S3KeyPrefixInformation)1 Storage (org.finra.herd.model.api.xml.Storage)1