Search in sources :

Example 31 with Schema

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

the class BusinessObjectFormatServiceTest method testUpdateBusinessObjectFormatLowerCaseParameters.

@Test
public void testUpdateBusinessObjectFormatLowerCaseParameters() {
    // Create an initial version of the format using upper case input parameters.
    BusinessObjectFormatEntity businessObjectFormatEntity = businessObjectFormatDaoTestHelper.createBusinessObjectFormatEntity(NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), INITIAL_FORMAT_VERSION, FORMAT_DESCRIPTION, LATEST_VERSION_FLAG_SET, PARTITION_KEY.toUpperCase(), NO_PARTITION_KEY_GROUP, Arrays.asList(new Attribute(ATTRIBUTE_NAME_1_MIXED_CASE.toUpperCase(), ATTRIBUTE_VALUE_1.toUpperCase())));
    // Create a new partition key group for the update request.
    partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP_2.toUpperCase());
    // Perform an update by changing the format description and schema.
    Schema testSchema = businessObjectFormatServiceTestHelper.getTestSchema2();
    testSchema.setPartitionKeyGroup(testSchema.getPartitionKeyGroup().toLowerCase());
    BusinessObjectFormatUpdateRequest request = businessObjectFormatServiceTestHelper.createBusinessObjectFormatUpdateRequest(FORMAT_DESCRIPTION_2.toLowerCase(), Arrays.asList(new Attribute(ATTRIBUTE_NAME_1_MIXED_CASE.toLowerCase(), ATTRIBUTE_VALUE_1.toLowerCase())), businessObjectFormatServiceTestHelper.getTestSchema2());
    BusinessObjectFormat updatedBusinessObjectFormat = businessObjectFormatService.updateBusinessObjectFormat(new BusinessObjectFormatKey(NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), INITIAL_FORMAT_VERSION), request);
    // Validate the returned object.
    Schema expectedSchema = businessObjectFormatServiceTestHelper.getTestSchema2();
    expectedSchema.setPartitionKeyGroup(expectedSchema.getPartitionKeyGroup().toUpperCase());
    businessObjectFormatServiceTestHelper.validateBusinessObjectFormat(businessObjectFormatEntity.getId(), NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), INITIAL_FORMAT_VERSION, LATEST_VERSION_FLAG_SET, PARTITION_KEY.toUpperCase(), FORMAT_DESCRIPTION_2.toLowerCase(), Arrays.asList(new Attribute(ATTRIBUTE_NAME_1_MIXED_CASE.toUpperCase(), ATTRIBUTE_VALUE_1.toLowerCase())), null, expectedSchema, updatedBusinessObjectFormat);
}
Also used : Attribute(org.finra.herd.model.api.xml.Attribute) Schema(org.finra.herd.model.api.xml.Schema) BusinessObjectFormatKey(org.finra.herd.model.api.xml.BusinessObjectFormatKey) BusinessObjectFormatEntity(org.finra.herd.model.jpa.BusinessObjectFormatEntity) DescriptiveBusinessObjectFormat(org.finra.herd.model.api.xml.DescriptiveBusinessObjectFormat) BusinessObjectFormat(org.finra.herd.model.api.xml.BusinessObjectFormat) BusinessObjectFormatUpdateRequest(org.finra.herd.model.api.xml.BusinessObjectFormatUpdateRequest) DescriptiveBusinessObjectFormatUpdateRequest(org.finra.herd.model.api.xml.DescriptiveBusinessObjectFormatUpdateRequest) Test(org.junit.Test)

Aggregations

Schema (org.finra.herd.model.api.xml.Schema)31 Test (org.junit.Test)27 BusinessObjectFormat (org.finra.herd.model.api.xml.BusinessObjectFormat)22 BusinessObjectFormatCreateRequest (org.finra.herd.model.api.xml.BusinessObjectFormatCreateRequest)21 DescriptiveBusinessObjectFormat (org.finra.herd.model.api.xml.DescriptiveBusinessObjectFormat)18 Attribute (org.finra.herd.model.api.xml.Attribute)9 BusinessObjectFormatKey (org.finra.herd.model.api.xml.BusinessObjectFormatKey)9 SchemaColumn (org.finra.herd.model.api.xml.SchemaColumn)8 BusinessObjectFormatEntity (org.finra.herd.model.jpa.BusinessObjectFormatEntity)8 BusinessObjectDefinitionKey (org.finra.herd.model.api.xml.BusinessObjectDefinitionKey)3 BusinessObjectFormatUpdateRequest (org.finra.herd.model.api.xml.BusinessObjectFormatUpdateRequest)3 DescriptiveBusinessObjectFormatUpdateRequest (org.finra.herd.model.api.xml.DescriptiveBusinessObjectFormatUpdateRequest)3 BusinessObjectData (org.finra.herd.model.api.xml.BusinessObjectData)2 RelationalTableRegistrationCreateRequest (org.finra.herd.model.api.xml.RelationalTableRegistrationCreateRequest)2 Storage (org.finra.herd.model.api.xml.Storage)2 StorageUnit (org.finra.herd.model.api.xml.StorageUnit)2 BusinessObjectDefinitionEntity (org.finra.herd.model.jpa.BusinessObjectDefinitionEntity)2 ArrayList (java.util.ArrayList)1 AttributeDefinition (org.finra.herd.model.api.xml.AttributeDefinition)1 BusinessObjectDefinition (org.finra.herd.model.api.xml.BusinessObjectDefinition)1