@RequestParam(value = "createNewVersion", required = false, defaultValue = "false") Boolean createNewVersion, ServletRequest servletRequest) return storageUnitService.getS3KeyPrefix( validateRequestAndCreateBusinessObjectDataKey(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType, businessObjectFormatVersion, partitionValue, subPartitionValues, businessObjectDataVersion, servletRequest), partitionKey, storageName,
@RequestParam(value = "createNewVersion", required = false, defaultValue = "false") Boolean createNewVersion, ServletRequest servletRequest) return storageUnitService.getS3KeyPrefix( validateRequestAndCreateBusinessObjectDataKey(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType, businessObjectFormatVersion, partitionValue, subPartitionValues, businessObjectDataVersion, servletRequest), partitionKey, storageName,
@Test public void testGetS3KeyPrefixUpperCaseParameters() { // Create database entities required for testing. Please note that we are not passing the flag to create a business object data entity. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(false); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); List<SchemaColumn> testSubPartitionColumns = testPartitionColumns.subList(1, SUBPARTITION_VALUES.size() + 1); // Get an S3 key prefix using upper case input parameters (except for case-sensitive partition values). S3KeyPrefixInformation resultS3KeyPrefixInformation = storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), testPartitionKey.toUpperCase(), STORAGE_NAME.toUpperCase(), false); // Get the expected S3 key prefix value using the business object data version. String expectedS3KeyPrefix = getExpectedS3KeyPrefix(NAMESPACE, DATA_PROVIDER_NAME, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, testPartitionKey, PARTITION_VALUE, testSubPartitionColumns.toArray(new SchemaColumn[testSubPartitionColumns.size()]), SUBPARTITION_VALUES.toArray(new String[SUBPARTITION_VALUES.size()]), DATA_VERSION); // Validate the results. assertEquals(new S3KeyPrefixInformation(expectedS3KeyPrefix), resultS3KeyPrefixInformation); }
@Test public void testGetS3KeyPrefixLowerCaseParameters() { // Create database entities required for testing. Please note that we are not passing the flag to create a business object data entity. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(false); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); List<SchemaColumn> testSubPartitionColumns = testPartitionColumns.subList(1, SUBPARTITION_VALUES.size() + 1); // Get an S3 key prefix using lower case input parameters (except for case-sensitive partition values). S3KeyPrefixInformation resultS3KeyPrefixInformation = storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), testPartitionKey.toLowerCase(), STORAGE_NAME.toLowerCase(), false); // Get the expected S3 key prefix value using the business object data version. String expectedS3KeyPrefix = getExpectedS3KeyPrefix(NAMESPACE, DATA_PROVIDER_NAME, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, testPartitionKey, PARTITION_VALUE, testSubPartitionColumns.toArray(new SchemaColumn[testSubPartitionColumns.size()]), SUBPARTITION_VALUES.toArray(new String[SUBPARTITION_VALUES.size()]), DATA_VERSION); // Validate the results. assertEquals(new S3KeyPrefixInformation(expectedS3KeyPrefix), resultS3KeyPrefixInformation); }
@Test public void testGetS3KeyPrefix() { // 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 delimited list of sub-partition values. String delimitedSubPartitionValues = String.join("|", SUBPARTITION_VALUES); // Create an S3 key prefix information. S3KeyPrefixInformation s3KeyPrefixInformation = new S3KeyPrefixInformation(); // Mock a servlet request. ServletRequest servletRequest = mock(ServletRequest.class); when(servletRequest.getParameterMap()).thenReturn(new HashMap<>()); // Mock the external calls. when(herdStringHelper.splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues)).thenReturn(SUBPARTITION_VALUES); when(storageUnitService.getS3KeyPrefix(businessObjectDataKey, PARTITION_KEY, STORAGE_NAME, CREATE_NEW_VERSION)).thenReturn(s3KeyPrefixInformation); // Call the method under test. S3KeyPrefixInformation result = businessObjectDataRestController .getS3KeyPrefix(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_KEY, PARTITION_VALUE, delimitedSubPartitionValues, DATA_VERSION, STORAGE_NAME, CREATE_NEW_VERSION, servletRequest); // Verify the external calls. verify(herdStringHelper).splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues); verify(storageUnitService).getS3KeyPrefix(businessObjectDataKey, PARTITION_KEY, STORAGE_NAME, CREATE_NEW_VERSION); verifyNoMoreInteractionsHelper(); // Validate the results. assertEquals(s3KeyPrefixInformation, result); }
@Test public void testGetS3KeyPrefixNoDataVersionSpecifiedLatestDataVersionExistsCreateNewVersionIsTrue() { // Create database entities required for testing. Please note that we are passing the flag to create a business object data entity. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(true); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); List<SchemaColumn> testSubPartitionColumns = testPartitionColumns.subList(1, SUBPARTITION_VALUES.size() + 1); // Get an S3 key prefix for the next business object data by not passing the business object data version and passing the create new version flag. S3KeyPrefixInformation resultS3KeyPrefixInformation = storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, null), testPartitionKey, STORAGE_NAME, true); // Get the expected S3 key prefix value using the next business object data version. String expectedS3KeyPrefix = getExpectedS3KeyPrefix(NAMESPACE, DATA_PROVIDER_NAME, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, testPartitionKey, PARTITION_VALUE, testSubPartitionColumns.toArray(new SchemaColumn[testSubPartitionColumns.size()]), SUBPARTITION_VALUES.toArray(new String[SUBPARTITION_VALUES.size()]), DATA_VERSION + 1); // Validate the results. assertEquals(new S3KeyPrefixInformation(expectedS3KeyPrefix), resultS3KeyPrefixInformation); }
@Test public void testGetS3KeyPrefix() { // Create database entities required for testing. Please note that we are not passing the flag to create a business object data entity. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(false); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); List<SchemaColumn> testSubPartitionColumns = testPartitionColumns.subList(1, SUBPARTITION_VALUES.size() + 1); // Get an S3 key prefix by passing all parameters including partition key, business object data version, // and "create new version" flag (has no effect when data version is specified). S3KeyPrefixInformation resultS3KeyPrefixInformation = storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), testPartitionKey, STORAGE_NAME, false); // Get the expected S3 key prefix value using the business object data version. String expectedS3KeyPrefix = getExpectedS3KeyPrefix(NAMESPACE, DATA_PROVIDER_NAME, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, testPartitionKey, PARTITION_VALUE, testSubPartitionColumns.toArray(new SchemaColumn[testSubPartitionColumns.size()]), SUBPARTITION_VALUES.toArray(new String[SUBPARTITION_VALUES.size()]), DATA_VERSION); // Validate the results. assertEquals(new S3KeyPrefixInformation(expectedS3KeyPrefix), resultS3KeyPrefixInformation); }
S3KeyPrefixInformation resultS3KeyPrefixInformation = storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, null), testPartitionKey, STORAGE_NAME, createNewVersionFlag);
@Test public void testGetS3KeyPrefixMissingOptionalParameters() { // Create a business object definition. businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(NAMESPACE, BDEF_NAME, DATA_PROVIDER_NAME, BDEF_DESCRIPTION); // Create database entities required for testing. Please note that we are not passing the flag to create a business object data entity. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(false); // Test if we can get an S3 key prefix without specifying optional parameters // including passing all 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); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); List<SchemaColumn> testSubPartitionColumns = testPartitionColumns.subList(1, subPartitionValues.size() + 1); // Get an S3 key prefix without passing any of the optional parameters. S3KeyPrefixInformation resultS3KeyPrefixInformation = storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, subPartitionValues, null), BLANK_TEXT, BLANK_TEXT, null); // Get the expected S3 key prefix value using the initial business object data version. String expectedS3KeyPrefix = getExpectedS3KeyPrefix(NAMESPACE, DATA_PROVIDER_NAME, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, testPartitionKey, PARTITION_VALUE, testSubPartitionColumns.toArray(new SchemaColumn[testSubPartitionColumns.size()]), SUBPARTITION_VALUES.toArray(new String[SUBPARTITION_VALUES.size()]), INITIAL_DATA_VERSION); // Validate the results. assertEquals(new S3KeyPrefixInformation(expectedS3KeyPrefix), resultS3KeyPrefixInformation); } }
storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BLANK_TEXT, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), PARTITION_KEY, STORAGE_NAME, false); storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, BLANK_TEXT, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), PARTITION_KEY, STORAGE_NAME, false); storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, BLANK_TEXT, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), PARTITION_KEY, STORAGE_NAME, false); storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, BLANK_TEXT, SUBPARTITION_VALUES, DATA_VERSION), PARTITION_KEY, STORAGE_NAME, false); storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, Arrays.asList(BLANK_TEXT), DATA_VERSION), PARTITION_KEY, STORAGE_NAME, false);
@Test public void testGetS3KeyPrefixNonS3Storage() { // Create database entities required for testing. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(true); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); // Create a non-S3 storage. storageDaoTestHelper.createStorageEntity(STORAGE_NAME_2, STORAGE_PLATFORM_CODE); // Try to get an S3 key prefix specifying non-S3 storage. try { storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), testPartitionKey, STORAGE_NAME_2, false); fail("Should throw an IllegalArgumentException when specifying an non-S3 storage."); } catch (IllegalArgumentException e) { assertEquals(String.format("The specified storage \"%s\" is not an S3 storage platform.", STORAGE_NAME_2), e.getMessage()); } }
@Test public void testGetS3KeyPrefixTrimParameters() { // Create database entities required for testing. Please note that we are not passing the flag to create a business object data entity. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(false); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); List<SchemaColumn> testSubPartitionColumns = testPartitionColumns.subList(1, SUBPARTITION_VALUES.size() + 1); // Get an S3 key prefix by using input parameters with leading and trailing empty spaces. S3KeyPrefixInformation resultS3KeyPrefixInformation = storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(addWhitespace(NAMESPACE), addWhitespace(BDEF_NAME), addWhitespace(FORMAT_USAGE_CODE), addWhitespace(FORMAT_FILE_TYPE_CODE), FORMAT_VERSION, addWhitespace(PARTITION_VALUE), addWhitespace(SUBPARTITION_VALUES), DATA_VERSION), addWhitespace(testPartitionKey), addWhitespace(STORAGE_NAME), false); // Get the expected S3 key prefix value using the business object data version. String expectedS3KeyPrefix = getExpectedS3KeyPrefix(NAMESPACE, DATA_PROVIDER_NAME, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, testPartitionKey, PARTITION_VALUE, testSubPartitionColumns.toArray(new SchemaColumn[testSubPartitionColumns.size()]), SUBPARTITION_VALUES.toArray(new String[SUBPARTITION_VALUES.size()]), DATA_VERSION); // Validate the results. assertEquals(new S3KeyPrefixInformation(expectedS3KeyPrefix), resultS3KeyPrefixInformation); }
storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), testPartitionKey, STORAGE_NAME_2, false); storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), testPartitionKey, STORAGE_NAME_3, false);
@Test public void testGetS3KeyPrefixKeyPrefixVelocityTemplateProducesBlankS3KeyPrefix() { // Create database entities required for testing. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(true); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); final String testS3KeyPrefixVelocityTemplate = "#if($CollectionUtils.isNotEmpty($businessObjectDataSubPartitions.keySet()))#end"; // Create an S3 storage entity with the S3 key prefix template that would result in a blank S3 key prefix value. storageDaoTestHelper.createStorageEntity(STORAGE_NAME_2, StoragePlatformEntity.S3, Arrays.asList( new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_KEY_PREFIX_VELOCITY_TEMPLATE), testS3KeyPrefixVelocityTemplate))); // Try to get an S3 key prefix specifying an S3 storage with the S3 key prefix velocity template that results in a blank S3 key prefix value. try { storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), testPartitionKey, STORAGE_NAME_2, false); fail("Should throw an IllegalArgumentException when specifying an S3 storage with the S3 key prefix velocity template " + "that results in a blank S3 key prefix value."); } catch (IllegalArgumentException e) { assertEquals(String.format("S3 key prefix velocity template \"%s\" configured for \"%s\" storage results in an empty S3 key prefix.", testS3KeyPrefixVelocityTemplate, STORAGE_NAME_2), e.getMessage()); } }
@Test public void testGetS3KeyPrefixNoDataVersionSpecifiedLatestDataVersionExistsCreateNewVersionIsFalse() { // Create database entities required for testing. Please note that we are passing the flag to create a business object data entity. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(true); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); // Try to get an S3 key prefix for the next business object data with the create new version flag not set to "true". try { storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, null), testPartitionKey, STORAGE_NAME, false); } catch (AlreadyExistsException e) { assertEquals("Initial version of the business object data already exists.", e.getMessage()); } }
@Test public void testGetS3KeyPrefixUndefinedVelocityVariable() { // Create database entities required for testing. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(true); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); // Create an undefined velocity variable. String undefinedVelocityVariable = "$UNDEFINED_VARIABLE"; // Create an S3 storage entity with the S3 key prefix template containing an undefined variable. storageDaoTestHelper.createStorageEntity(STORAGE_NAME_2, StoragePlatformEntity.S3, Arrays.asList( new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_KEY_PREFIX_VELOCITY_TEMPLATE), undefinedVelocityVariable))); // Try to get an S3 key prefix when the S3 key prefix velocity template contains an undefined variable. try { storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), testPartitionKey, STORAGE_NAME_2, false); fail("Should throw an MethodInvocationException when the S3 key prefix velocity template contains an undefined variable."); } catch (MethodInvocationException e) { assertEquals(String.format("Variable %s has not been set at %s[line 1, column 1]", undefinedVelocityVariable, configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_KEY_PREFIX_VELOCITY_TEMPLATE)), e.getMessage()); } }
storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, null), partitionKey, STORAGE_NAME, false);
@Test public void testGetS3KeyPrefixMissingOptionalParametersPassedAsNulls() { // Create a business object definition. businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(NAMESPACE, BDEF_NAME, DATA_PROVIDER_NAME, BDEF_DESCRIPTION); // Create database entities required for testing. Please note that we are not passing the flag to create a business object data entity. businessObjectDataServiceTestHelper.createDatabaseEntitiesForGetS3KeyPrefixTesting(false); // Get the test partition columns. List<SchemaColumn> testPartitionColumns = schemaColumnDaoTestHelper.getTestPartitionColumns(); String testPartitionKey = testPartitionColumns.get(0).getName(); // Get an S3 key prefix by passing null values for the namespace and partition key. S3KeyPrefixInformation resultS3KeyPrefixInformation = storageUnitService.getS3KeyPrefix( new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION), null, null, false); // Get the expected S3 key prefix value using the business object data version. String expectedS3KeyPrefix = getExpectedS3KeyPrefix(NAMESPACE, DATA_PROVIDER_NAME, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, testPartitionKey, PARTITION_VALUE, null, null, DATA_VERSION); // Validate the results. assertEquals(new S3KeyPrefixInformation(expectedS3KeyPrefix), resultS3KeyPrefixInformation); }
businessObjectDataKey.setBusinessObjectDataVersion(businessObjectDataVersion); S3KeyPrefixInformation s3KeyPrefixInformation = storageUnitService.getS3KeyPrefix(businessObjectDataKey, partitionKey, storageName, createNewVersion);
businessObjectDataKey.setBusinessObjectDataVersion(businessObjectDataVersion); S3KeyPrefixInformation s3KeyPrefixInformation = storageUnitService.getS3KeyPrefix(businessObjectDataKey, partitionKey, storageName, createNewVersion);