public StorageUnitEntity createDatabaseEntitiesForBusinessObjectDataDdlTesting(String partitionValue,String s3KeyPrefix){
  List<SchemaColumn> schemaColumns=new ArrayList<>();
  schemaColumns.add(new SchemaColumn(AbstractServiceTest.FIRST_PARTITION_COLUMN_NAME,"DATE",AbstractServiceTest.NO_COLUMN_SIZE,AbstractServiceTest.COLUMN_REQUIRED,AbstractServiceTest.NO_COLUMN_DEFAULT_VALUE,AbstractServiceTest.NO_COLUMN_DESCRIPTION));
  schemaColumns.add(new SchemaColumn(AbstractServiceTest.COLUMN_NAME,"NUMBER",AbstractServiceTest.COLUMN_SIZE,AbstractServiceTest.NO_COLUMN_REQUIRED,AbstractServiceTest.COLUMN_DEFAULT_VALUE,AbstractServiceTest.COLUMN_DESCRIPTION));
  List<SchemaColumn> partitionColumns=schemaColumns.subList(0,1);
  BusinessObjectFormatEntity businessObjectFormatEntity=businessObjectFormatDaoTestHelper.createBusinessObjectFormatEntity(AbstractServiceTest.NAMESPACE,AbstractServiceTest.BDEF_NAME,AbstractServiceTest.FORMAT_USAGE_CODE,FileTypeEntity.TXT_FILE_TYPE,AbstractServiceTest.FORMAT_VERSION,AbstractServiceTest.FORMAT_DESCRIPTION,AbstractServiceTest.LATEST_VERSION_FLAG_SET,AbstractServiceTest.FIRST_PARTITION_COLUMN_NAME,AbstractServiceTest.NO_PARTITION_KEY_GROUP,AbstractServiceTest.NO_ATTRIBUTES,AbstractServiceTest.SCHEMA_DELIMITER_PIPE,AbstractServiceTest.SCHEMA_ESCAPE_CHARACTER_BACKSLASH,AbstractServiceTest.SCHEMA_NULL_VALUE_BACKSLASH_N,schemaColumns,partitionColumns);
  if (partitionValue != null) {
    BusinessObjectDataEntity businessObjectDataEntity=businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(businessObjectFormatEntity,partitionValue,AbstractServiceTest.NO_SUBPARTITION_VALUES,AbstractServiceTest.DATA_VERSION,AbstractServiceTest.LATEST_VERSION_FLAG_SET,BusinessObjectDataStatusEntity.VALID);
    StorageEntity storageEntity=storageDaoTestHelper.createStorageEntity(AbstractServiceTest.STORAGE_NAME,StoragePlatformEntity.S3,Arrays.asList(new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_BUCKET_NAME),AbstractServiceTest.S3_BUCKET_NAME),new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_KEY_PREFIX_VELOCITY_TEMPLATE),AbstractServiceTest.S3_KEY_PREFIX_VELOCITY_TEMPLATE)));
    return storageUnitDaoTestHelper.createStorageUnitEntity(storageEntity,businessObjectDataEntity,StorageUnitStatusEntity.ENABLED,s3KeyPrefix);
  }
  return null;
}

public StorageUnitEntity createDatabaseEntitiesForBusinessObjectDataDdlTesting ( String partitionValue , String s3KeyPrefix ) { List < SchemaColumn > schemaColumns = new ArrayList < > ( ) ; schemaColumns . add ( new SchemaColumn ( AbstractServiceTest . FIRST_PARTITION_COLUMN_NAME , "DATE" , AbstractServiceTest . NO_COLUMN_SIZE , AbstractServiceTest . COLUMN_REQUIRED , AbstractServiceTest . NO_COLUMN_DEFAULT_VALUE , AbstractServiceTest . NO_COLUMN_DESCRIPTION ) ) ; schemaColumns . add ( new SchemaColumn ( AbstractServiceTest . COLUMN_NAME , "NUMBER" , AbstractServiceTest . COLUMN_SIZE , AbstractServiceTest . NO_COLUMN_REQUIRED , AbstractServiceTest . COLUMN_DEFAULT_VALUE , AbstractServiceTest . COLUMN_DESCRIPTION ) ) ; List < SchemaColumn > partitionColumns = schemaColumns . subList ( 0 , 1 ) ; BusinessObjectFormatEntity businessObjectFormatEntity = businessObjectFormatDaoTestHelper . createBusinessObjectFormatEntity ( AbstractServiceTest . NAMESPACE , AbstractServiceTest . BDEF_NAME , AbstractServiceTest . FORMAT_USAGE_CODE , FileTypeEntity . TXT_FILE_TYPE , AbstractServiceTest . FORMAT_VERSION , AbstractServiceTest . FORMAT_DESCRIPTION , AbstractServiceTest . LATEST_VERSION_FLAG_SET , AbstractServiceTest . FIRST_PARTITION_COLUMN_NAME , AbstractServiceTest . NO_PARTITION_KEY_GROUP , AbstractServiceTest . NO_ATTRIBUTES , AbstractServiceTest . SCHEMA_DELIMITER_PIPE , AbstractServiceTest . SCHEMA_ESCAPE_CHARACTER_BACKSLASH , AbstractServiceTest . SCHEMA_NULL_VALUE_BACKSLASH_N , schemaColumns , partitionColumns ) ; if ( partitionValue != null ) { BusinessObjectDataEntity businessObjectDataEntity = businessObjectDataDaoTestHelper . createBusinessObjectDataEntity ( businessObjectFormatEntity , partitionValue , AbstractServiceTest . NO_SUBPARTITION_VALUES , AbstractServiceTest . DATA_VERSION , AbstractServiceTest . LATEST_VERSION_FLAG_SET , BusinessObjectDataStatusEntity . VALID ) ; StorageEntity storageEntity = storageDaoTestHelper . createStorageEntity ( AbstractServiceTest . STORAGE_NAME , StoragePlatformEntity . S3 , Arrays . asList ( new Attribute ( configurationHelper . getProperty ( ConfigurationValue . S3_ATTRIBUTE_NAME_BUCKET_NAME ) , AbstractServiceTest . S3_BUCKET_NAME ) , new Attribute ( configurationHelper . getProperty ( ConfigurationValue . S3_ATTRIBUTE_NAME_KEY_PREFIX_VELOCITY_TEMPLATE ) , AbstractServiceTest . S3_KEY_PREFIX_VELOCITY_TEMPLATE ) ) ) ; return storageUnitDaoTestHelper . createStorageUnitEntity ( storageEntity , businessObjectDataEntity , StorageUnitStatusEntity . ENABLED , s3KeyPrefix ) ; } return null ; }
creates and persists database entities required for generate business object data ddl testing .
