use of org.activiti.bpmn.model.FieldExtension in project herd by FINRAOS.
the class UpdateBusinessObjectDataStatusTest method testUpdateBusinessObjectDataStatusMissingOptionalParameters.
@Test
public void testUpdateBusinessObjectDataStatusMissingOptionalParameters() throws Exception {
// Create a business object data key without sub-partition values.
BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION);
// Create a business object data entity.
businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(businessObjectDataKey, LATEST_VERSION_FLAG_SET, BDATA_STATUS);
// Create a business object data status entity.
businessObjectDataStatusDaoTestHelper.createBusinessObjectDataStatusEntity(BDATA_STATUS_2);
List<FieldExtension> fieldExtensionList = new ArrayList<>();
fieldExtensionList.add(buildFieldExtension("namespace", "${namespace}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDefinitionName", "${businessObjectDefinitionName}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatUsage", "${businessObjectFormatUsage}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatFileType", "${businessObjectFormatFileType}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatVersion", "${businessObjectFormatVersion}"));
fieldExtensionList.add(buildFieldExtension("partitionValue", "${partitionValue}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataVersion", "${businessObjectDataVersion}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataStatus", "${businessObjectDataStatus}"));
List<Parameter> parameters = new ArrayList<>();
parameters.add(buildParameter("namespace", BDEF_NAMESPACE));
parameters.add(buildParameter("businessObjectDefinitionName", BDEF_NAME));
parameters.add(buildParameter("businessObjectFormatUsage", FORMAT_USAGE_CODE));
parameters.add(buildParameter("businessObjectFormatFileType", FORMAT_FILE_TYPE_CODE));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString()));
parameters.add(buildParameter("partitionValue", PARTITION_VALUE));
parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString()));
parameters.add(buildParameter("businessObjectDataStatus", BDATA_STATUS_2));
// Build the expected response object.
BusinessObjectDataStatusUpdateResponse expectedBusinessObjectDataStatusUpdateResponse = new BusinessObjectDataStatusUpdateResponse(businessObjectDataKey, BDATA_STATUS_2, BDATA_STATUS);
// Run the activiti task and validate the returned response object.
Map<String, Object> variableValuesToValidate = new HashMap<>();
variableValuesToValidate.put(UpdateBusinessObjectDataStatus.VARIABLE_JSON_RESPONSE, jsonHelper.objectToJson(expectedBusinessObjectDataStatusUpdateResponse));
testActivitiServiceTaskSuccess(UpdateBusinessObjectDataStatus.class.getCanonicalName(), fieldExtensionList, parameters, variableValuesToValidate);
}
use of org.activiti.bpmn.model.FieldExtension in project herd by FINRAOS.
the class SearchBusinessObjectDataTest method testSearchBusinessObjectDataWithJson.
@Test
public void testSearchBusinessObjectDataWithJson() throws Exception {
this.businessObjectDataServiceTestHelper.createDatabaseEntitiesForBusinessObjectDataSearchTesting();
BusinessObjectDataSearchRequest businessObjectDataSearchRequest = getBusinessObjectDataSearchRequest();
List<FieldExtension> fieldExtensionList = new ArrayList<>();
fieldExtensionList.add(buildFieldExtension("contentType", "${contentType}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataSearchRequest", "${businessObjectDataSearchRequest}"));
List<Parameter> parameters = new ArrayList<>();
parameters.add(buildParameter("contentType", "json"));
parameters.add(buildParameter("businessObjectDataSearchRequest", jsonHelper.objectToJson(businessObjectDataSearchRequest)));
parameters.add(buildParameter("pageNum", PAGE_NUMBER_ONE.toString()));
parameters.add(buildParameter("pageSize", PAGE_SIZE_ONE_THOUSAND.toString()));
// Get the expected result by calling the service method directly.
BusinessObjectDataSearchResultPagingInfoDto result = this.businessObjectDataService.searchBusinessObjectData(PAGE_NUMBER_ONE, PAGE_SIZE_ONE_THOUSAND, businessObjectDataSearchRequest);
Map<String, Object> variableValuesToValidate = new HashMap<>();
variableValuesToValidate.put(BaseJavaDelegate.VARIABLE_JSON_RESPONSE, jsonHelper.objectToJson(result.getBusinessObjectDataSearchResult()));
testActivitiServiceTaskSuccess(SearchBusinessObjectData.class.getCanonicalName(), fieldExtensionList, parameters, variableValuesToValidate);
}
use of org.activiti.bpmn.model.FieldExtension in project herd by FINRAOS.
the class UpdateBusinessObjectDataAttributeTest method testUpdateBusinessObjectDataAttribute.
@Test
public void testUpdateBusinessObjectDataAttribute() throws Exception {
// Create a business object data key.
BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION);
// Create a business object data attribute entity.
BusinessObjectDataAttributeEntity businessObjectDataAttributeEntity = businessObjectDataAttributeDaoTestHelper.createBusinessObjectDataAttributeEntity(businessObjectDataKey, ATTRIBUTE_NAME_1_MIXED_CASE, ATTRIBUTE_VALUE_1);
List<FieldExtension> fieldExtensionList = new ArrayList<>();
fieldExtensionList.add(buildFieldExtension("namespace", "${namespace}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDefinitionName", "${businessObjectDefinitionName}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatUsage", "${businessObjectFormatUsage}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatFileType", "${businessObjectFormatFileType}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatVersion", "${businessObjectFormatVersion}"));
fieldExtensionList.add(buildFieldExtension("partitionValue", "${partitionValue}"));
fieldExtensionList.add(buildFieldExtension("subPartitionValues", "${subPartitionValues}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataVersion", "${businessObjectDataVersion}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataAttributeName", "${businessObjectDataAttributeName}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataAttributeValue", "${businessObjectDataAttributeValue}"));
List<Parameter> parameters = new ArrayList<>();
parameters.add(buildParameter("namespace", BDEF_NAMESPACE));
parameters.add(buildParameter("businessObjectDefinitionName", BDEF_NAME));
parameters.add(buildParameter("businessObjectFormatUsage", FORMAT_USAGE_CODE));
parameters.add(buildParameter("businessObjectFormatFileType", FORMAT_FILE_TYPE_CODE));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString()));
parameters.add(buildParameter("partitionValue", PARTITION_VALUE));
parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES)));
parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString()));
parameters.add(buildParameter("businessObjectDataAttributeName", ATTRIBUTE_NAME_1_MIXED_CASE));
parameters.add(buildParameter("businessObjectDataAttributeValue", ATTRIBUTE_VALUE_2));
// Build the expected response object.
BusinessObjectDataAttribute expectedBusinessObjectDataAttribute = new BusinessObjectDataAttribute(businessObjectDataAttributeEntity.getId(), businessObjectDataAttributeHelper.getBusinessObjectDataAttributeKey(businessObjectDataKey, ATTRIBUTE_NAME_1_MIXED_CASE), ATTRIBUTE_VALUE_2);
// Run the activiti task and validate the returned response object.
Map<String, Object> variableValuesToValidate = new HashMap<>();
variableValuesToValidate.put(UpdateBusinessObjectDataAttribute.VARIABLE_JSON_RESPONSE, jsonHelper.objectToJson(expectedBusinessObjectDataAttribute));
testActivitiServiceTaskSuccess(UpdateBusinessObjectDataAttribute.class.getCanonicalName(), fieldExtensionList, parameters, variableValuesToValidate);
}
use of org.activiti.bpmn.model.FieldExtension in project herd by FINRAOS.
the class UpdateBusinessObjectDataStorageUnitStatusTest method testUpdateBusinessObjectDataStorageUnitStatusMissingOptionalParametersSubPartitionValuesAsEmptyString.
@Test
public void testUpdateBusinessObjectDataStorageUnitStatusMissingOptionalParametersSubPartitionValuesAsEmptyString() throws Exception {
// Create a business object data storage unit key.
BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey = new BusinessObjectDataStorageUnitKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION, STORAGE_NAME);
// Create a storage unit entity.
storageUnitDaoTestHelper.createStorageUnitEntity(businessObjectDataStorageUnitKey, STORAGE_UNIT_STATUS);
// Create a storage unit status entity.
storageUnitStatusDaoTestHelper.createStorageUnitStatusEntity(STORAGE_UNIT_STATUS_2);
List<FieldExtension> fieldExtensionList = new ArrayList<>();
fieldExtensionList.add(buildFieldExtension("namespace", "${namespace}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDefinitionName", "${businessObjectDefinitionName}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatUsage", "${businessObjectFormatUsage}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatFileType", "${businessObjectFormatFileType}"));
fieldExtensionList.add(buildFieldExtension("businessObjectFormatVersion", "${businessObjectFormatVersion}"));
fieldExtensionList.add(buildFieldExtension("partitionValue", "${partitionValue}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataVersion", "${businessObjectDataVersion}"));
fieldExtensionList.add(buildFieldExtension("storageName", "${storageName}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataStorageUnitStatus", "${businessObjectDataStorageUnitStatus}"));
List<Parameter> parameters = new ArrayList<>();
parameters.add(buildParameter("namespace", BDEF_NAMESPACE));
parameters.add(buildParameter("businessObjectDefinitionName", BDEF_NAME));
parameters.add(buildParameter("businessObjectFormatUsage", FORMAT_USAGE_CODE));
parameters.add(buildParameter("businessObjectFormatFileType", FORMAT_FILE_TYPE_CODE));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString()));
parameters.add(buildParameter("partitionValue", PARTITION_VALUE));
parameters.add(buildParameter("subPartitionValues", EMPTY_STRING));
parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString()));
parameters.add(buildParameter("storageName", STORAGE_NAME));
parameters.add(buildParameter("businessObjectDataStorageUnitStatus", STORAGE_UNIT_STATUS_2));
// Build the expected response object.
BusinessObjectDataStorageUnitStatusUpdateResponse expectedResponse = new BusinessObjectDataStorageUnitStatusUpdateResponse(businessObjectDataStorageUnitKey, STORAGE_UNIT_STATUS_2, STORAGE_UNIT_STATUS);
// Run the activiti task and validate the returned response object.
Map<String, Object> variableValuesToValidate = new HashMap<>();
variableValuesToValidate.put(UpdateBusinessObjectDataStorageUnitStatus.VARIABLE_JSON_RESPONSE, jsonHelper.objectToJson(expectedResponse));
testActivitiServiceTaskSuccess(UpdateBusinessObjectDataStorageUnitStatus.class.getCanonicalName(), fieldExtensionList, parameters, variableValuesToValidate);
}
use of org.activiti.bpmn.model.FieldExtension in project herd by FINRAOS.
the class CheckBusinessObjectDataAvailabilityMultiplePartitionsTest method testCheckBusinessObjectDataAvailabilityMultiplePartitionsXml.
@Test
public void testCheckBusinessObjectDataAvailabilityMultiplePartitionsXml() throws Exception {
// Prepare test data.
businessObjectDataAvailabilityTestHelper.createDatabaseEntitiesForBusinessObjectDataAvailabilityTesting(null);
// Prepare a check business object data availability request.
BusinessObjectDataAvailabilityRequest businessObjectDataAvailabilityRequest = businessObjectDataServiceTestHelper.getTestBusinessObjectDataAvailabilityRequest(UNSORTED_PARTITION_VALUES);
List<FieldExtension> fieldExtensionList = new ArrayList<>();
fieldExtensionList.add(buildFieldExtension("contentType", "${contentType}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataAvailabilityRequest", "${businessObjectDataAvailabilityRequest}"));
List<Parameter> parameters = new ArrayList<>();
parameters.add(buildParameter("contentType", "xml"));
parameters.add(buildParameter("businessObjectDataAvailabilityRequest", xmlHelper.objectToXml(businessObjectDataAvailabilityRequest)));
Map<String, Object> variableValuesToValidate = new HashMap<>();
variableValuesToValidate.put(CheckBusinessObjectDataAvailabilityMultiplePartitions.VARIABLE_IS_ALL_DATA_AVAILABLE, false);
variableValuesToValidate.put(BaseJavaDelegate.VARIABLE_JSON_RESPONSE, VARIABLE_VALUE_NOT_NULL);
testActivitiServiceTaskSuccess(CheckBusinessObjectDataAvailabilityMultiplePartitions.class.getCanonicalName(), fieldExtensionList, parameters, variableValuesToValidate);
}
Aggregations