Search in sources :

Example 1 with BusinessObjectDataAttributeKeys

use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.

the class BusinessObjectDataAttributeServiceTest method testGetBusinessObjectDataAttributesLowerCaseParameters.

@Test
public void testGetBusinessObjectDataAttributesLowerCaseParameters() {
    // List of test business object data attribute names.
    List<String> testBusinessObjectDataAttributeNames = Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE, ATTRIBUTE_NAME_2_MIXED_CASE);
    // Create and persist a business object data attribute entities using upper case values.
    for (String businessObjectDataAttributeName : testBusinessObjectDataAttributeNames) {
        businessObjectDataAttributeDaoTestHelper.createBusinessObjectDataAttributeEntity(NAMESPACE, BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, PARTITION_VALUE.toUpperCase(), convertListToUpperCase(SUBPARTITION_VALUES), DATA_VERSION, businessObjectDataAttributeName.toUpperCase(), ATTRIBUTE_VALUE_1.toUpperCase());
    }
    // Retrieve a list of business object data attribute keys using lower case input parameters (except for case-sensitive partition values).
    BusinessObjectDataAttributeKeys resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION, PARTITION_VALUE.toUpperCase(), convertListToUpperCase(SUBPARTITION_VALUES), DATA_VERSION));
    // Validate the returned object.
    assertNotNull(resultBusinessObjectDataAttributeKeys);
    assertEquals(testBusinessObjectDataAttributeNames.size(), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().size());
    for (int i = 0; i < testBusinessObjectDataAttributeNames.size(); i++) {
        businessObjectDataAttributeServiceTestHelper.validateBusinessObjectDataAttributeKey(NAMESPACE, BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, PARTITION_VALUE.toUpperCase(), convertListToUpperCase(SUBPARTITION_VALUES), DATA_VERSION, testBusinessObjectDataAttributeNames.get(i).toUpperCase(), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().get(i));
    }
}
Also used : BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys) Test(org.junit.Test)

Example 2 with BusinessObjectDataAttributeKeys

use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.

the class BusinessObjectDataAttributeServiceTest method testGetBusinessObjectDataAttributes.

@Test
public void testGetBusinessObjectDataAttributes() {
    // List of test business object data attribute names.
    List<String> testBusinessObjectDataAttributeNames = Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE, ATTRIBUTE_NAME_2_MIXED_CASE);
    // Create and persist a business object data attribute entities.
    for (String businessObjectDataAttributeName : testBusinessObjectDataAttributeNames) {
        businessObjectDataAttributeDaoTestHelper.createBusinessObjectDataAttributeEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, businessObjectDataAttributeName, ATTRIBUTE_VALUE_1);
    }
    // Retrieve a list of business object data attribute keys.
    BusinessObjectDataAttributeKeys resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION));
    // Validate the returned object.
    assertNotNull(resultBusinessObjectDataAttributeKeys);
    assertEquals(testBusinessObjectDataAttributeNames.size(), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().size());
    for (int i = 0; i < testBusinessObjectDataAttributeNames.size(); i++) {
        businessObjectDataAttributeServiceTestHelper.validateBusinessObjectDataAttributeKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, testBusinessObjectDataAttributeNames.get(i), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().get(i));
    }
}
Also used : BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys) Test(org.junit.Test)

Example 3 with BusinessObjectDataAttributeKeys

use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.

the class BusinessObjectDataAttributeServiceTest method testGetBusinessObjectDataAttributesUpperCaseParameters.

@Test
public void testGetBusinessObjectDataAttributesUpperCaseParameters() {
    // List of test business object data attribute names.
    List<String> testBusinessObjectDataAttributeNames = Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE, ATTRIBUTE_NAME_2_MIXED_CASE);
    // Create and persist a business object data attribute entities using lower case values.
    for (String businessObjectDataAttributeName : testBusinessObjectDataAttributeNames) {
        businessObjectDataAttributeDaoTestHelper.createBusinessObjectDataAttributeEntity(NAMESPACE, BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION, PARTITION_VALUE.toLowerCase(), convertListToLowerCase(SUBPARTITION_VALUES), DATA_VERSION, businessObjectDataAttributeName.toLowerCase(), ATTRIBUTE_VALUE_1.toLowerCase());
    }
    // Retrieve a list of business object data attribute keys using upper case input parameters (except for case-sensitive partition values).
    BusinessObjectDataAttributeKeys resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, PARTITION_VALUE.toLowerCase(), convertListToLowerCase(SUBPARTITION_VALUES), DATA_VERSION));
    // Validate the returned object.
    assertNotNull(resultBusinessObjectDataAttributeKeys);
    assertEquals(testBusinessObjectDataAttributeNames.size(), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().size());
    for (int i = 0; i < testBusinessObjectDataAttributeNames.size(); i++) {
        businessObjectDataAttributeServiceTestHelper.validateBusinessObjectDataAttributeKey(NAMESPACE, BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION, PARTITION_VALUE.toLowerCase(), convertListToLowerCase(SUBPARTITION_VALUES), DATA_VERSION, testBusinessObjectDataAttributeNames.get(i).toLowerCase(), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().get(i));
    }
}
Also used : BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys) Test(org.junit.Test)

Example 4 with BusinessObjectDataAttributeKeys

use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.

the class BusinessObjectDataAttributeServiceTest method testGetBusinessObjectDataAttributesTrimParameters.

@Test
public void testGetBusinessObjectDataAttributesTrimParameters() {
    // List of test business object data attribute names.
    List<String> testBusinessObjectDataAttributeNames = Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE, ATTRIBUTE_NAME_2_MIXED_CASE);
    // Create and persist a business object data attribute entities.
    for (String businessObjectDataAttributeName : testBusinessObjectDataAttributeNames) {
        businessObjectDataAttributeDaoTestHelper.createBusinessObjectDataAttributeEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, businessObjectDataAttributeName, ATTRIBUTE_VALUE_1);
    }
    // Retrieve a list of business object data attribute keys using input parameters with leading and trailing empty spaces.
    BusinessObjectDataAttributeKeys resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, addWhitespace(BDEF_NAME), addWhitespace(FORMAT_USAGE_CODE), addWhitespace(FORMAT_FILE_TYPE_CODE), FORMAT_VERSION, addWhitespace(PARTITION_VALUE), addWhitespace(SUBPARTITION_VALUES), DATA_VERSION));
    // Validate the returned object.
    assertNotNull(resultBusinessObjectDataAttributeKeys);
    assertEquals(testBusinessObjectDataAttributeNames.size(), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().size());
    for (int i = 0; i < testBusinessObjectDataAttributeNames.size(); i++) {
        businessObjectDataAttributeServiceTestHelper.validateBusinessObjectDataAttributeKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, testBusinessObjectDataAttributeNames.get(i), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().get(i));
    }
}
Also used : BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys) Test(org.junit.Test)

Example 5 with BusinessObjectDataAttributeKeys

use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.

the class BusinessObjectDataAttributeServiceTest method testGetBusinessObjectDataAttributesMissingOptionalParameters.

@Test
public void testGetBusinessObjectDataAttributesMissingOptionalParameters() {
    // List of test business object data attribute names.
    List<String> testBusinessObjectDataAttributeNames = Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE, ATTRIBUTE_NAME_2_MIXED_CASE);
    // with any allowed number of subpartition values (from 0 to MAX_SUBPARTITIONS).
    for (int i = 0; i <= BusinessObjectDataEntity.MAX_SUBPARTITIONS; i++) {
        // Build a list of subpartition values.
        List<String> subPartitionValues = SUBPARTITION_VALUES.subList(0, i);
        // Create and persist business object data attribute entities with the relative number of subpartition values.
        for (String businessObjectDataAttributeName : testBusinessObjectDataAttributeNames) {
            businessObjectDataAttributeDaoTestHelper.createBusinessObjectDataAttributeEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, subPartitionValues, DATA_VERSION, businessObjectDataAttributeName, ATTRIBUTE_VALUE_1);
        }
        // Retrieve the list of attribute keys for the business object data using the relative endpoint.
        BusinessObjectDataAttributeKeys resultBusinessObjectDataAttributeKeys = null;
        switch(i) {
            case 0:
                resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION));
                break;
            case 1:
                resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, Arrays.asList(SUBPARTITION_VALUES.get(0)), DATA_VERSION));
                break;
            case 2:
                resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, Arrays.asList(SUBPARTITION_VALUES.get(0), SUBPARTITION_VALUES.get(1)), DATA_VERSION));
                break;
            case 3:
                resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, Arrays.asList(SUBPARTITION_VALUES.get(0), SUBPARTITION_VALUES.get(1), SUBPARTITION_VALUES.get(2)), DATA_VERSION));
                break;
            case 4:
                resultBusinessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION));
                break;
        }
        // Validate the returned object.
        assertNotNull(resultBusinessObjectDataAttributeKeys);
        assertEquals(testBusinessObjectDataAttributeNames.size(), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().size());
        for (int j = 0; j < testBusinessObjectDataAttributeNames.size(); j++) {
            businessObjectDataAttributeServiceTestHelper.validateBusinessObjectDataAttributeKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, subPartitionValues, DATA_VERSION, testBusinessObjectDataAttributeNames.get(j), resultBusinessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().get(j));
        }
    }
}
Also used : BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys) Test(org.junit.Test)

Aggregations

BusinessObjectDataAttributeKeys (org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys)16 BusinessObjectDataKey (org.finra.herd.model.api.xml.BusinessObjectDataKey)15 Test (org.junit.Test)14 BusinessObjectDataAttributeKey (org.finra.herd.model.api.xml.BusinessObjectDataAttributeKey)5 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 FieldExtension (org.activiti.bpmn.model.FieldExtension)3 Attribute (org.finra.herd.model.api.xml.Attribute)3 Parameter (org.finra.herd.model.api.xml.Parameter)3 BusinessObjectDataAttributeEntity (org.finra.herd.model.jpa.BusinessObjectDataAttributeEntity)1 BusinessObjectDataEntity (org.finra.herd.model.jpa.BusinessObjectDataEntity)1