use of org.finra.herd.core.Command in project herd by FINRAOS.
the class BusinessObjectDataServiceCreateBusinessObjectDataTest method testCreateBusinessObjectDataAttributeValueTooLarge.
@Test(expected = PersistenceException.class)
public void testCreateBusinessObjectDataAttributeValueTooLarge() throws Exception {
final BusinessObjectDataCreateRequest businessObjectDataCreateRequest = businessObjectDataServiceTestHelper.getNewBusinessObjectDataCreateRequest();
// Create and add a duplicate attribute which is not allowed.
Attribute newAttribute = new Attribute();
newAttribute.setName("Valid Name");
// Test value greater than 4000 byte limit.
newAttribute.setValue(new String(new char[4001]).replace('\0', 'A'));
businessObjectDataCreateRequest.getAttributes().add(newAttribute);
executeWithoutLogging(SqlExceptionHelper.class, new Command() {
@Override
public void execute() {
// Create the business object data which is invalid.
businessObjectDataService.createBusinessObjectData(businessObjectDataCreateRequest);
}
});
}
use of org.finra.herd.core.Command 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