use of org.finra.herd.model.jpa.BusinessObjectDataEntity in project herd by FINRAOS.
the class BusinessObjectDataAttributeDaoImpl method getBusinessObjectDataAttributeByKey.
@Override
public BusinessObjectDataAttributeEntity getBusinessObjectDataAttributeByKey(BusinessObjectDataAttributeKey businessObjectDataAttributeKey) {
// Create the criteria builder and the criteria.
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<BusinessObjectDataAttributeEntity> criteria = builder.createQuery(BusinessObjectDataAttributeEntity.class);
// The criteria root is the business object data attribute.
Root<BusinessObjectDataAttributeEntity> businessObjectDataAttributeEntityRoot = criteria.from(BusinessObjectDataAttributeEntity.class);
// Join to the other tables we can filter on.
Join<BusinessObjectDataAttributeEntity, BusinessObjectDataEntity> businessObjectDataEntityJoin = businessObjectDataAttributeEntityRoot.join(BusinessObjectDataAttributeEntity_.businessObjectData);
Join<BusinessObjectDataEntity, BusinessObjectFormatEntity> businessObjectFormatEntityJoin = businessObjectDataEntityJoin.join(BusinessObjectDataEntity_.businessObjectFormat);
Join<BusinessObjectFormatEntity, FileTypeEntity> fileTypeEntityJoin = businessObjectFormatEntityJoin.join(BusinessObjectFormatEntity_.fileType);
Join<BusinessObjectFormatEntity, BusinessObjectDefinitionEntity> businessObjectDefinitionEntityJoin = businessObjectFormatEntityJoin.join(BusinessObjectFormatEntity_.businessObjectDefinition);
Join<BusinessObjectDefinitionEntity, NamespaceEntity> namespaceEntityJoin = businessObjectDefinitionEntityJoin.join(BusinessObjectDefinitionEntity_.namespace);
// Create the standard restrictions (i.e. the standard where clauses).
List<Predicate> predicates = new ArrayList<>();
predicates.add(builder.equal(builder.upper(namespaceEntityJoin.get(NamespaceEntity_.code)), businessObjectDataAttributeKey.getNamespace().toUpperCase()));
predicates.add(builder.equal(builder.upper(businessObjectDefinitionEntityJoin.get(BusinessObjectDefinitionEntity_.name)), businessObjectDataAttributeKey.getBusinessObjectDefinitionName().toUpperCase()));
predicates.add(builder.equal(builder.upper(businessObjectDefinitionEntityJoin.get(BusinessObjectDefinitionEntity_.name)), businessObjectDataAttributeKey.getBusinessObjectDefinitionName().toUpperCase()));
predicates.add(builder.equal(builder.upper(businessObjectFormatEntityJoin.get(BusinessObjectFormatEntity_.usage)), businessObjectDataAttributeKey.getBusinessObjectFormatUsage().toUpperCase()));
predicates.add(builder.equal(builder.upper(fileTypeEntityJoin.get(FileTypeEntity_.code)), businessObjectDataAttributeKey.getBusinessObjectFormatFileType().toUpperCase()));
predicates.add(builder.equal(businessObjectFormatEntityJoin.get(BusinessObjectFormatEntity_.businessObjectFormatVersion), businessObjectDataAttributeKey.getBusinessObjectFormatVersion()));
predicates.add(getQueryRestrictionOnPartitionValues(builder, businessObjectDataEntityJoin, businessObjectDataAttributeKey.getPartitionValue(), businessObjectDataAttributeKey.getSubPartitionValues()));
predicates.add(builder.equal(businessObjectDataEntityJoin.get(BusinessObjectDataEntity_.version), businessObjectDataAttributeKey.getBusinessObjectDataVersion()));
predicates.add(builder.equal(builder.upper(businessObjectDataAttributeEntityRoot.get(BusinessObjectDataAttributeEntity_.name)), businessObjectDataAttributeKey.getBusinessObjectDataAttributeName().toUpperCase()));
// Add the clauses for the query.
criteria.select(businessObjectDataAttributeEntityRoot).where(builder.and(predicates.toArray(new Predicate[predicates.size()])));
return executeSingleResultQuery(criteria, String.format("Found more than one business object data attribute instance with parameters {namespace=\"%s\", businessObjectDefinitionName=\"%s\"," + " businessObjectFormatUsage=\"%s\", businessObjectFormatFileType=\"%s\", businessObjectFormatVersion=\"%d\"," + " businessObjectDataPartitionValue=\"%s\", businessObjectDataSubPartitionValues=\"%s\", businessObjectDataVersion=\"%d\"," + " businessObjectDataAttributeName=\"%s\"}.", businessObjectDataAttributeKey.getNamespace(), businessObjectDataAttributeKey.getBusinessObjectDefinitionName(), businessObjectDataAttributeKey.getBusinessObjectFormatUsage(), businessObjectDataAttributeKey.getBusinessObjectFormatFileType(), businessObjectDataAttributeKey.getBusinessObjectFormatVersion(), businessObjectDataAttributeKey.getPartitionValue(), CollectionUtils.isEmpty(businessObjectDataAttributeKey.getSubPartitionValues()) ? "" : StringUtils.join(businessObjectDataAttributeKey.getSubPartitionValues(), ","), businessObjectDataAttributeKey.getBusinessObjectDataVersion(), businessObjectDataAttributeKey.getBusinessObjectDataAttributeName()));
}
use of org.finra.herd.model.jpa.BusinessObjectDataEntity in project herd by FINRAOS.
the class AbstractHerdDao method getMaximumBusinessObjectDataVersionSubQuery.
/**
* TODO This method may be bdata specific. Consider creating new abstract class to group all bdata related DAO. Builds a sub-query to select the maximum
* business object data version.
*
* @param builder the criteria builder
* @param criteria the criteria query
* @param businessObjectDataEntity the business object data entity that appears in the from clause of the main query
* @param businessObjectFormatEntity the business object format entity that appears in the from clause of the main query
* @param businessObjectDataStatus the business object data status
* @param storageNames the list of storage names where the business object data storage units should be looked for (case-insensitive)
* @param storagePlatformType the optional storage platform type, e.g. S3 for Hive DDL. It is ignored when the list of storages is not empty
* @param excludedStoragePlatformType the optional storage platform type to be excluded from search. It is ignored when the list of storages is not empty or
* the storage platform type is specified
* @param selectOnlyAvailableStorageUnits specifies if only available storage units will be selected or any storage units regardless of their status
*
* @return the sub-query to select the maximum business object data version
*/
protected Subquery<Integer> getMaximumBusinessObjectDataVersionSubQuery(CriteriaBuilder builder, CriteriaQuery<?> criteria, From<?, BusinessObjectDataEntity> businessObjectDataEntity, From<?, BusinessObjectFormatEntity> businessObjectFormatEntity, String businessObjectDataStatus, List<String> storageNames, String storagePlatformType, String excludedStoragePlatformType, boolean selectOnlyAvailableStorageUnits) {
// Business object data version is not specified, so get the latest one in the specified storage.
Subquery<Integer> subQuery = criteria.subquery(Integer.class);
// The criteria root is the business object data.
Root<BusinessObjectDataEntity> subBusinessObjectDataEntity = subQuery.from(BusinessObjectDataEntity.class);
// Join to the other tables we can filter on.
Join<BusinessObjectDataEntity, StorageUnitEntity> subStorageUnitEntity = subBusinessObjectDataEntity.join(BusinessObjectDataEntity_.storageUnits);
Join<StorageUnitEntity, StorageEntity> subStorageEntity = subStorageUnitEntity.join(StorageUnitEntity_.storage);
Join<StorageEntity, StoragePlatformEntity> subStoragePlatformEntity = subStorageEntity.join(StorageEntity_.storagePlatform);
Join<BusinessObjectDataEntity, BusinessObjectFormatEntity> subBusinessObjectFormatEntity = subBusinessObjectDataEntity.join(BusinessObjectDataEntity_.businessObjectFormat);
Join<StorageUnitEntity, StorageUnitStatusEntity> subStorageUnitStatusEntity = subStorageUnitEntity.join(StorageUnitEntity_.status);
// Add a standard restriction on business object format.
Predicate subQueryRestriction = builder.equal(subBusinessObjectFormatEntity, businessObjectFormatEntity);
// Create and add standard restrictions on primary and sub-partition values.
subQueryRestriction = builder.and(subQueryRestriction, getQueryRestrictionOnPartitionValues(builder, subBusinessObjectDataEntity, businessObjectDataEntity));
// If specified, create and add a standard restriction on business object data status.
if (businessObjectDataStatus != null) {
Join<BusinessObjectDataEntity, BusinessObjectDataStatusEntity> subBusinessObjectDataStatusEntity = subBusinessObjectDataEntity.join(BusinessObjectDataEntity_.status);
subQueryRestriction = builder.and(subQueryRestriction, builder.equal(builder.upper(subBusinessObjectDataStatusEntity.get(BusinessObjectDataStatusEntity_.code)), businessObjectDataStatus.toUpperCase()));
}
// Create and add a standard restriction on storage.
subQueryRestriction = builder.and(subQueryRestriction, getQueryRestrictionOnStorage(builder, subStorageEntity, subStoragePlatformEntity, storageNames, storagePlatformType, excludedStoragePlatformType));
// If specified, add a restriction on storage unit status availability flag.
if (selectOnlyAvailableStorageUnits) {
subQueryRestriction = builder.and(subQueryRestriction, builder.isTrue(subStorageUnitStatusEntity.get(StorageUnitStatusEntity_.available)));
}
subQuery.select(builder.max(subBusinessObjectDataEntity.get(BusinessObjectDataEntity_.version))).where(subQueryRestriction);
return subQuery;
}
use of org.finra.herd.model.jpa.BusinessObjectDataEntity in project herd by FINRAOS.
the class StoragePolicySelectorServiceTest method testExecuteBusinessObjectDataNotSelectedDueToHigherPriorityLevelStoragePolicy.
@Test
public void testExecuteBusinessObjectDataNotSelectedDueToHigherPriorityLevelStoragePolicy() {
// Storage a storage policy with a filter that has no fields specified.
storagePolicyDaoTestHelper.createStoragePolicyEntity(new StoragePolicyKey(STORAGE_POLICY_NAMESPACE_CD_2, STORAGE_POLICY_NAME_2), StoragePolicyRuleTypeEntity.DAYS_SINCE_BDATA_REGISTERED, BDATA_AGE_IN_DAYS, NO_BDEF_NAMESPACE, NO_BDEF_NAME, NO_FORMAT_USAGE_CODE, NO_FORMAT_FILE_TYPE_CODE, STORAGE_NAME, StoragePolicyTransitionTypeEntity.GLACIER, StoragePolicyStatusEntity.ENABLED, INITIAL_VERSION, LATEST_VERSION_FLAG_SET);
// Create and persist a storage unit in the storage policy filter storage.
StorageUnitEntity storageUnitEntity = storageUnitDaoTestHelper.createStorageUnitEntity(STORAGE_NAME, BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, LATEST_VERSION_FLAG_SET, BusinessObjectDataStatusEntity.VALID, StorageUnitStatusEntity.ENABLED, NO_STORAGE_DIRECTORY_PATH);
// Get the business object data entity.
BusinessObjectDataEntity businessObjectDataEntity = storageUnitEntity.getBusinessObjectData();
// Apply the offset in days to business object data "created on" value, so it would match to the storage policy.
businessObjectDataDaoTestHelper.ageBusinessObjectData(businessObjectDataEntity, BDATA_AGE_IN_DAYS + 1);
// Execute the storage policy selection and validate the results. The business object data is expected to be selected.
assertEquals(1, storagePolicySelectorService.execute(AWS_SQS_QUEUE_NAME, MAX_RESULT).size());
// Storage a storage policy with a filter that has only usage and file type specified
// and with the age restriction greater than the current business object data entity age.
storagePolicyDaoTestHelper.createStoragePolicyEntity(new StoragePolicyKey(STORAGE_POLICY_NAMESPACE_CD_2, STORAGE_POLICY_NAME), StoragePolicyRuleTypeEntity.DAYS_SINCE_BDATA_REGISTERED, BDATA_AGE_IN_DAYS + 2, NO_BDEF_NAMESPACE, NO_BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, STORAGE_NAME, StoragePolicyTransitionTypeEntity.GLACIER, StoragePolicyStatusEntity.ENABLED, INITIAL_VERSION, LATEST_VERSION_FLAG_SET);
// Execute the storage policy selection and validate the results. The business object data is not expected to be selected.
assertEquals(0, storagePolicySelectorService.execute(AWS_SQS_QUEUE_NAME, MAX_RESULT).size());
// Apply the offset in days to business object data "created on" value, so it would match to the last added storage policy.
businessObjectDataDaoTestHelper.ageBusinessObjectData(businessObjectDataEntity, 2);
// Execute the storage policy selection and validate the results. The business object data is expected to be selected.
assertEquals(1, storagePolicySelectorService.execute(AWS_SQS_QUEUE_NAME, MAX_RESULT).size());
// Storage a storage policy with a filter that has only business object definition
// specified and with the age restriction greater than the current business object data entity age.
storagePolicyDaoTestHelper.createStoragePolicyEntity(new StoragePolicyKey(STORAGE_POLICY_NAMESPACE_CD, STORAGE_POLICY_NAME_2), StoragePolicyRuleTypeEntity.DAYS_SINCE_BDATA_REGISTERED, BDATA_AGE_IN_DAYS + 4, BDEF_NAMESPACE, BDEF_NAME, NO_FORMAT_USAGE_CODE, NO_FORMAT_FILE_TYPE_CODE, STORAGE_NAME, StoragePolicyTransitionTypeEntity.GLACIER, StoragePolicyStatusEntity.ENABLED, INITIAL_VERSION, LATEST_VERSION_FLAG_SET);
// Execute the storage policy selection and validate the results. The business object data is not expected to be selected.
assertEquals(0, storagePolicySelectorService.execute(AWS_SQS_QUEUE_NAME, MAX_RESULT).size());
// Apply the offset in days to business object data "created on" value, so it would match to the last added storage policy.
businessObjectDataDaoTestHelper.ageBusinessObjectData(businessObjectDataEntity, 2);
// Execute the storage policy selection and validate the results. The business object data is expected to be selected.
assertEquals(1, storagePolicySelectorService.execute(AWS_SQS_QUEUE_NAME, MAX_RESULT).size());
// Storage a storage policy with a filter that has business object definition, usage, and file type
// specified and with the age restriction greater than the current business object data entity age.
storagePolicyDaoTestHelper.createStoragePolicyEntity(new StoragePolicyKey(STORAGE_POLICY_NAMESPACE_CD, STORAGE_POLICY_NAME), StoragePolicyRuleTypeEntity.DAYS_SINCE_BDATA_REGISTERED, BDATA_AGE_IN_DAYS + 6, BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, STORAGE_NAME, StoragePolicyTransitionTypeEntity.GLACIER, StoragePolicyStatusEntity.ENABLED, INITIAL_VERSION, LATEST_VERSION_FLAG_SET);
// Execute the storage policy selection and validate the results. The business object data is not expected to be selected.
assertEquals(0, storagePolicySelectorService.execute(AWS_SQS_QUEUE_NAME, MAX_RESULT).size());
// Apply the offset in days to business object data "created on" value, so it would match to the last added storage policy.
businessObjectDataDaoTestHelper.ageBusinessObjectData(businessObjectDataEntity, 2);
// Execute the storage policy selection and validate the results. The business object data is expected to be selected.
assertEquals(1, storagePolicySelectorService.execute(AWS_SQS_QUEUE_NAME, MAX_RESULT).size());
}
use of org.finra.herd.model.jpa.BusinessObjectDataEntity in project herd by FINRAOS.
the class UploadDownloadHelperServiceTest method testExecuteFileMoveAfterStepsNewTargetStatusNotValid.
@Test
public void testExecuteFileMoveAfterStepsNewTargetStatusNotValid() {
// Create and persists entities required for testing.
BusinessObjectDataEntity sourceBusinessObjectDataEntity = businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION, PARTITION_VALUE, INITIAL_DATA_VERSION, LATEST_VERSION_FLAG_SET, BusinessObjectDataStatusEntity.RE_ENCRYPTING);
StorageUnitEntity sourceStorageUnitEntity = storageUnitDaoTestHelper.createStorageUnitEntity(storageDaoHelper.getStorageEntity(StorageEntity.MANAGED_LOADING_DOCK_STORAGE), sourceBusinessObjectDataEntity, StorageUnitStatusEntity.ENABLED, NO_STORAGE_DIRECTORY_PATH);
storageFileDaoTestHelper.createStorageFileEntity(sourceStorageUnitEntity, TARGET_S3_KEY, FILE_SIZE_1_KB, NO_ROW_COUNT);
BusinessObjectDataEntity targetBusinessObjectDataEntity = businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, INITIAL_FORMAT_VERSION, PARTITION_VALUE, INITIAL_DATA_VERSION, LATEST_VERSION_FLAG_SET, BusinessObjectDataStatusEntity.RE_ENCRYPTING);
StorageUnitEntity targetStorageUnitEntity = storageUnitDaoTestHelper.createStorageUnitEntity(storageDaoHelper.getStorageEntity(StorageEntity.MANAGED_EXTERNAL_STORAGE), targetBusinessObjectDataEntity, StorageUnitStatusEntity.ENABLED, NO_STORAGE_DIRECTORY_PATH);
storageFileDaoTestHelper.createStorageFileEntity(targetStorageUnitEntity, TARGET_S3_KEY, FILE_SIZE_1_KB, NO_ROW_COUNT);
// Put a 1 KB file in the source S3 bucket.
PutObjectRequest putObjectRequest = new PutObjectRequest(storageDaoTestHelper.getS3LoadingDockBucketName(), TARGET_S3_KEY, new ByteArrayInputStream(new byte[(int) FILE_SIZE_1_KB]), null);
s3Operations.putObject(putObjectRequest, null);
// Initialize parameters required to perform the file move post steps with new target status not being set to "VALID".
CompleteUploadSingleParamsDto completeUploadSingleParamsDto = new CompleteUploadSingleParamsDto(businessObjectDataHelper.getBusinessObjectDataKey(sourceBusinessObjectDataEntity), storageDaoTestHelper.getS3LoadingDockBucketName(), TARGET_S3_KEY, BusinessObjectDataStatusEntity.UPLOADING, BusinessObjectDataStatusEntity.RE_ENCRYPTING, businessObjectDataHelper.getBusinessObjectDataKey(targetBusinessObjectDataEntity), storageDaoTestHelper.getS3ExternalBucketName(), TARGET_S3_KEY, BusinessObjectDataStatusEntity.RE_ENCRYPTING, BusinessObjectDataStatusEntity.INVALID, MockS3OperationsImpl.MOCK_KMS_ID, emrHelper.getAwsParamsDto());
// Try to execute the file move post steps when new target business object data status is not set to "VALID".
uploadDownloadHelperService.executeFileMoveAfterSteps(completeUploadSingleParamsDto);
// Refresh the data entities.
sourceBusinessObjectDataEntity = businessObjectDataDaoHelper.getBusinessObjectDataEntity(businessObjectDataHelper.getBusinessObjectDataKey(sourceBusinessObjectDataEntity));
targetBusinessObjectDataEntity = businessObjectDataDaoHelper.getBusinessObjectDataEntity(businessObjectDataHelper.getBusinessObjectDataKey(targetBusinessObjectDataEntity));
// Validate the source and target business object data statuses.
assertEquals(BusinessObjectDataStatusEntity.DELETED, sourceBusinessObjectDataEntity.getStatus().getCode());
assertEquals(BusinessObjectDataStatusEntity.INVALID, targetBusinessObjectDataEntity.getStatus().getCode());
// Validate the updated DTO parameters.
assertEquals(BusinessObjectDataStatusEntity.DELETED, completeUploadSingleParamsDto.getSourceNewStatus());
assertEquals(BusinessObjectDataStatusEntity.RE_ENCRYPTING, completeUploadSingleParamsDto.getSourceOldStatus());
assertEquals(BusinessObjectDataStatusEntity.INVALID, completeUploadSingleParamsDto.getTargetNewStatus());
assertEquals(BusinessObjectDataStatusEntity.RE_ENCRYPTING, completeUploadSingleParamsDto.getTargetOldStatus());
}
use of org.finra.herd.model.jpa.BusinessObjectDataEntity in project herd by FINRAOS.
the class UploadDownloadHelperServiceTest method testExecuteFileMoveAfterSteps.
@Test
public void testExecuteFileMoveAfterSteps() {
// Create and persists entities required for testing.
BusinessObjectDataEntity sourceBusinessObjectDataEntity = businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION, PARTITION_VALUE, INITIAL_DATA_VERSION, LATEST_VERSION_FLAG_SET, BusinessObjectDataStatusEntity.RE_ENCRYPTING);
StorageUnitEntity sourceStorageUnitEntity = storageUnitDaoTestHelper.createStorageUnitEntity(storageDaoHelper.getStorageEntity(StorageEntity.MANAGED_LOADING_DOCK_STORAGE), sourceBusinessObjectDataEntity, StorageUnitStatusEntity.ENABLED, NO_STORAGE_DIRECTORY_PATH);
storageFileDaoTestHelper.createStorageFileEntity(sourceStorageUnitEntity, TARGET_S3_KEY, FILE_SIZE_1_KB, NO_ROW_COUNT);
BusinessObjectDataEntity targetBusinessObjectDataEntity = businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, INITIAL_FORMAT_VERSION, PARTITION_VALUE, INITIAL_DATA_VERSION, LATEST_VERSION_FLAG_SET, BusinessObjectDataStatusEntity.RE_ENCRYPTING);
StorageUnitEntity targetStorageUnitEntity = storageUnitDaoTestHelper.createStorageUnitEntity(storageDaoHelper.getStorageEntity(StorageEntity.MANAGED_EXTERNAL_STORAGE), targetBusinessObjectDataEntity, StorageUnitStatusEntity.ENABLED, NO_STORAGE_DIRECTORY_PATH);
storageFileDaoTestHelper.createStorageFileEntity(targetStorageUnitEntity, TARGET_S3_KEY, FILE_SIZE_1_KB, NO_ROW_COUNT);
// Put a 1 KB file in S3.
PutObjectRequest putObjectRequest = new PutObjectRequest(storageDaoTestHelper.getS3LoadingDockBucketName(), TARGET_S3_KEY, new ByteArrayInputStream(new byte[(int) FILE_SIZE_1_KB]), null);
s3Operations.putObject(putObjectRequest, null);
// Initialize parameters required to perform the file move post steps.
CompleteUploadSingleParamsDto completeUploadSingleParamsDto = new CompleteUploadSingleParamsDto(businessObjectDataHelper.getBusinessObjectDataKey(sourceBusinessObjectDataEntity), storageDaoTestHelper.getS3LoadingDockBucketName(), TARGET_S3_KEY, BusinessObjectDataStatusEntity.UPLOADING, BusinessObjectDataStatusEntity.RE_ENCRYPTING, businessObjectDataHelper.getBusinessObjectDataKey(targetBusinessObjectDataEntity), storageDaoTestHelper.getS3ExternalBucketName(), TARGET_S3_KEY, BusinessObjectDataStatusEntity.RE_ENCRYPTING, BusinessObjectDataStatusEntity.VALID, MockS3OperationsImpl.MOCK_KMS_ID, emrHelper.getAwsParamsDto());
// Execute the file move post steps.
uploadDownloadHelperService.executeFileMoveAfterSteps(completeUploadSingleParamsDto);
// Refresh the data entities.
sourceBusinessObjectDataEntity = businessObjectDataDaoHelper.getBusinessObjectDataEntity(businessObjectDataHelper.getBusinessObjectDataKey(sourceBusinessObjectDataEntity));
targetBusinessObjectDataEntity = businessObjectDataDaoHelper.getBusinessObjectDataEntity(businessObjectDataHelper.getBusinessObjectDataKey(targetBusinessObjectDataEntity));
// Validate the source and target business object data statuses.
assertEquals(BusinessObjectDataStatusEntity.DELETED, sourceBusinessObjectDataEntity.getStatus().getCode());
assertEquals(BusinessObjectDataStatusEntity.VALID, targetBusinessObjectDataEntity.getStatus().getCode());
// Validate the updated DTO parameters.
assertEquals(BusinessObjectDataStatusEntity.DELETED, completeUploadSingleParamsDto.getSourceNewStatus());
assertEquals(BusinessObjectDataStatusEntity.RE_ENCRYPTING, completeUploadSingleParamsDto.getSourceOldStatus());
assertEquals(BusinessObjectDataStatusEntity.VALID, completeUploadSingleParamsDto.getTargetNewStatus());
assertEquals(BusinessObjectDataStatusEntity.RE_ENCRYPTING, completeUploadSingleParamsDto.getTargetOldStatus());
}
Aggregations