use of org.finra.herd.model.api.xml.UploadBusinessObjectDefinitionSampleDataFileInitiationResponse in project herd by FINRAOS.
the class UploadDownloadServiceTest method testUploadBusinessObjectDefinitionSampleFileTrimedParameters.
@Test
public void testUploadBusinessObjectDefinitionSampleFileTrimedParameters() {
String s3_velocity_template = "$namespace/$businessObjectDefinitionName";
// Create a test storage.
storageDaoTestHelper.createStorageEntity(StorageEntity.SAMPLE_DATA_FILE_STORAGE, Arrays.asList(new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_BUCKET_NAME), S3_BUCKET_NAME), new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_UPLOAD_ROLE_ARN), UPLOADER_ROLE_ARN), new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_KEY_PREFIX_VELOCITY_TEMPLATE), s3_velocity_template)));
// Create and persist a business object definition entity with sample data files.
businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(NAMESPACE, BDEF_NAME, DATA_PROVIDER_NAME, BDEF_DESCRIPTION, BDEF_DISPLAY_NAME, businessObjectDefinitionServiceTestHelper.getNewAttributes());
UploadBusinessObjectDefinitionSampleDataFileInitiationRequest request = new UploadBusinessObjectDefinitionSampleDataFileInitiationRequest();
BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(NAMESPACE, BDEF_NAME);
BusinessObjectDefinitionKey businessObjectDefinitionKeyWhitespace = new BusinessObjectDefinitionKey(" " + NAMESPACE + " ", " " + BDEF_NAME + " ");
request.setBusinessObjectDefinitionKey(businessObjectDefinitionKeyWhitespace);
UploadBusinessObjectDefinitionSampleDataFileInitiationResponse response = uploadDownloadService.initiateUploadSampleFile(request);
assertEquals(response.getBusinessObjectDefinitionKey(), businessObjectDefinitionKey);
assertEquals(response.getAwsS3BucketName(), S3_BUCKET_NAME);
assertEquals(response.getAwsAccessKey(), MockStsOperationsImpl.MOCK_AWS_ASSUMED_ROLE_ACCESS_KEY);
assertEquals(response.getAwsSecretKey(), MockStsOperationsImpl.MOCK_AWS_ASSUMED_ROLE_SECRET_KEY);
assertEquals(response.getAwsSessionToken(), MockStsOperationsImpl.MOCK_AWS_ASSUMED_ROLE_SESSION_TOKEN);
}
Aggregations