@Test public void testCreateBusinessObjectDataPreRegistrationAssertDirectoryPathNotRequiredWhenStatusIsPreRegistrationAndDirectoryIsSetInResponse() { StorageEntity storageEntity = storageDaoTestHelper.createStorageEntity(STORAGE_NAME); storageEntity.getAttributes().add(storageDaoTestHelper .createStorageAttributeEntity(storageEntity, configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_KEY_PREFIX_VELOCITY_TEMPLATE), "foo")); // Create an initial version of the business object data. BusinessObjectDataCreateRequest businessObjectDataCreateRequest = businessObjectDataServiceTestHelper.getNewBusinessObjectDataCreateRequest(); businessObjectDataCreateRequest.setSubPartitionValues(null); businessObjectDataCreateRequest.setStatus("UPLOADING"); businessObjectDataCreateRequest.setStorageUnits(Arrays.asList(new StorageUnitCreateRequest(STORAGE_NAME, null, null, null))); BusinessObjectData businessObjectData = businessObjectDataService.createBusinessObjectData(businessObjectDataCreateRequest); assertEquals("foo", businessObjectData.getStorageUnits().get(0).getStorageDirectory().getDirectoryPath()); }
actualStorageUnit.getStorageDirectory() != null ? actualStorageUnit.getStorageDirectory().getDirectoryPath() : null); AbstractServiceTest.assertEqualsIgnoreOrder("storage files", expectedStorageFiles, actualStorageUnit.getStorageFiles());
theStorageDirectory = this.getStorageDirectory(); strategy.appendField(locator, this, "storageDirectory", buffer, theStorageDirectory, (this.storageDirectory!= null));
String expectedStorageDirectoryPath = String.format("%s/%s/%s", AbstractServiceTest.ENVIRONMENT_NAME.trim().toLowerCase().replace('_', '-'), expectedNamespaceCode.trim().toLowerCase().replace('_', '-'), businessObjectData.getPartitionValue()); assertEquals(expectedStorageDirectoryPath, storageUnit.getStorageDirectory().getDirectoryPath()); assertEquals(1, storageUnit.getStorageFiles().size()); StorageFile storageFile = storageUnit.getStorageFiles().get(0);
theStorageDirectory = this.getStorageDirectory(); strategy.appendField(locator, this, "storageDirectory", buffer, theStorageDirectory, (this.storageDirectory!= null));
theStorageDirectory = this.getStorageDirectory(); strategy.appendField(locator, this, "storageDirectory", buffer, theStorageDirectory, (this.storageDirectory!= null));
lhsStorageDirectory = this.getStorageDirectory(); StorageDirectory rhsStorageDirectory; rhsStorageDirectory = that.getStorageDirectory(); if (!strategy.equals(LocatorUtils.property(thisLocator, "storageDirectory", lhsStorageDirectory), LocatorUtils.property(thatLocator, "storageDirectory", rhsStorageDirectory), lhsStorageDirectory, rhsStorageDirectory, (this.storageDirectory!= null), (that.storageDirectory!= null))) { return false;
businessObjectDataHelper.createBusinessObjectDataKey(businessObjectData), STORAGE_NAME); StorageUnit storageUnit = businessObjectData.getStorageUnits().get(0); Assert.assertNotNull("response business object data[0] storage unit[0] storage directory is null", storageUnit.getStorageDirectory()); Assert.assertEquals("response business object data[0] storage unit[0] storage directory path", expectedS3KeyPrefix, storageUnit.getStorageDirectory().getDirectoryPath());
lhsStorageDirectory = this.getStorageDirectory(); StorageDirectory rhsStorageDirectory; rhsStorageDirectory = that.getStorageDirectory(); if (!strategy.equals(LocatorUtils.property(thisLocator, "storageDirectory", lhsStorageDirectory), LocatorUtils.property(thatLocator, "storageDirectory", rhsStorageDirectory), lhsStorageDirectory, rhsStorageDirectory, (this.storageDirectory!= null), (that.storageDirectory!= null))) { return false;
lhsStorageDirectory = this.getStorageDirectory(); StorageDirectory rhsStorageDirectory; rhsStorageDirectory = that.getStorageDirectory(); if (!strategy.equals(LocatorUtils.property(thisLocator, "storageDirectory", lhsStorageDirectory), LocatorUtils.property(thatLocator, "storageDirectory", rhsStorageDirectory), lhsStorageDirectory, rhsStorageDirectory, (this.storageDirectory!= null), (that.storageDirectory!= null))) { return false;
businessObjectDataHelper.createBusinessObjectDataKey(businessObjectData), STORAGE_NAME); StorageUnit storageUnit = businessObjectData.getStorageUnits().get(0); Assert.assertNotNull("response business object data[0] storage unit[0] storage directory is null", storageUnit.getStorageDirectory()); Assert.assertEquals("response business object data[0] storage unit[0] storage directory path", expectedS3KeyPrefix, storageUnit.getStorageDirectory().getDirectoryPath()); businessObjectDataHelper.createBusinessObjectDataKey(businessObjectData), STORAGE_NAME); StorageUnit storageUnit = businessObjectData.getStorageUnits().get(0); Assert.assertNotNull("response business object data[1] storage unit[0] storage directory is null", storageUnit.getStorageDirectory()); Assert.assertEquals("response business object data[1] storage unit[0] storage directory path", expectedS3KeyPrefix, storageUnit.getStorageDirectory().getDirectoryPath());
businessObjectDataHelper.createBusinessObjectDataKey(businessObjectData), STORAGE_NAME); StorageUnit storageUnit = businessObjectData.getStorageUnits().get(0); Assert.assertNotNull("response business object data[0] storage unit[0] storage directory is null", storageUnit.getStorageDirectory()); Assert.assertEquals("response business object data[0] storage unit[0] storage directory path", expectedS3KeyPrefix, storageUnit.getStorageDirectory().getDirectoryPath());
businessObjectDataHelper.createBusinessObjectDataKey(businessObjectData), STORAGE_NAME); StorageUnit storageUnit = businessObjectData.getStorageUnits().get(0); Assert.assertNotNull("response business object data[0] storage unit[0] storage directory is null", storageUnit.getStorageDirectory()); Assert.assertEquals("response business object data[0] storage unit[0] storage directory path", expectedS3KeyPrefix, storageUnit.getStorageDirectory().getDirectoryPath());
theStorageDirectory = this.getStorageDirectory(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storageDirectory", theStorageDirectory), currentHashCode, theStorageDirectory, (this.storageDirectory!= null));
theStorageDirectory = this.getStorageDirectory(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storageDirectory", theStorageDirectory), currentHashCode, theStorageDirectory, (this.storageDirectory!= null));
theStorageDirectory = this.getStorageDirectory(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storageDirectory", theStorageDirectory), currentHashCode, theStorageDirectory, (this.storageDirectory!= null));
assertEquals(storageUnit.getStorageDirectory(), resultStorageUnit.getStorageDirectory());
if (storageDirectoryShouldBeCopiedAndSet == Boolean.TRUE) { StorageDirectory sourceStorageDirectory; sourceStorageDirectory = this.getStorageDirectory(); StorageDirectory copyStorageDirectory = ((StorageDirectory) strategy.copy(LocatorUtils.property(locator, "storageDirectory", sourceStorageDirectory), sourceStorageDirectory, (this.storageDirectory!= null))); copy.setStorageDirectory(copyStorageDirectory);
if (storageDirectoryShouldBeCopiedAndSet == Boolean.TRUE) { StorageDirectory sourceStorageDirectory; sourceStorageDirectory = this.getStorageDirectory(); StorageDirectory copyStorageDirectory = ((StorageDirectory) strategy.copy(LocatorUtils.property(locator, "storageDirectory", sourceStorageDirectory), sourceStorageDirectory, (this.storageDirectory!= null))); copy.setStorageDirectory(copyStorageDirectory);
if (storageDirectoryShouldBeCopiedAndSet == Boolean.TRUE) { StorageDirectory sourceStorageDirectory; sourceStorageDirectory = this.getStorageDirectory(); StorageDirectory copyStorageDirectory = ((StorageDirectory) strategy.copy(LocatorUtils.property(locator, "storageDirectory", sourceStorageDirectory), sourceStorageDirectory, (this.storageDirectory!= null))); copy.setStorageDirectory(copyStorageDirectory);