StorageHelper { public Integer getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, Integer defaultValue) { Integer value = getStorageAttributeIntegerValueByName(attributeName, storageEntity, false, false); if (value == null) { value = defaultValue; } return value; }  boolean getBooleanStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
        boolean attributeValueRequiredIfExists); S3FileTransferRequestParamsDto getS3BucketAccessParams(StorageEntity storageEntity); S3FileCopyRequestParamsDto getS3FileCopyRequestParamsDto(); S3FileTransferRequestParamsDto getS3FileTransferRequestParamsDto(); S3FileTransferRequestParamsDto getS3FileTransferRequestParamsDtoByRole(String roleArn, String sessionName); Integer getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, Integer defaultValue); Integer getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
        boolean attributeValueRequiredIfExists); String getStorageAttributeValueByName(String attributeName, Storage storage, Boolean required); String getStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeValueRequired); String getStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
        boolean attributeValueRequiredIfExists); String getStorageBucketName(StorageEntity storageEntity); String getStorageKmsKeyId(StorageEntity storageEntity);  }
@Test public void testGetStorageAttributeIntegerValueByName_1() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = true; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(new Integer(attributeValue), value); }
@Test public void testGetStorageAttributeIntegerValueByName_2() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(new Integer(attributeValue), value); }
@Test public void testGetStorageAttributeIntegerValueByName_3() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = false; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(new Integer(attributeValue), value); }
@Test public void testGetStorageAttributeIntegerValueByName_4() { String attributeName = "test"; String attributeValue = "abcd"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = false; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByName_5() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = true; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Attribute \"" + attributeName + "\" for \"" + storageEntity.getName() + "\" storage must have a value that is not blank.", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByName_6() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByName_7() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = false; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByName_8() { String attributeName = "test"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntity(); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = true; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(null, value); }
@Test public void testGetStorageAttributeIntegerValueByName_9() { String attributeName = "test"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntity(); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Attribute \"" + attributeName + "\" for \"" + storageEntity.getName() + "\" storage must be configured.", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByName_10() { String attributeName = "test"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntity(); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = true; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(null, value); }
@Test public void testGetStorageAttributeIntegerValueByName_11() { String attributeName = "test"; String attributeValue = null; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = true; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Attribute \"" + attributeName + "\" for \"" + storageEntity.getName() + "\" storage must have a value that is not blank.", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByName_12() { String attributeName = "test"; String attributeValue = null; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(attributeValue, value); }
@Test public void testGetStorageAttributeIntegerValueByName_13() { String attributeName = "test"; String attributeValue = null; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; assertEquals(attributeValue, storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists)); }
@Test public void testGetStorageAttributeIntegerValueByNameWithDefault_1() { String attributeName = "test"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntity(); Integer defaultValue = 2345; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); assertEquals(defaultValue, value); }
@Test public void testGetStorageAttributeIntegerValueByNameWithDefault_2() { String attributeName = "test"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntity(); Integer defaultValue = null; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); assertEquals(defaultValue, value); }
@Test public void testGetStorageAttributeIntegerValueByNameWithDefault_3() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = 2345; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); assertEquals(new Integer(attributeValue), value); }
@Test public void testGetStorageAttributeIntegerValueByNameWithDefault_4() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = null; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); assertEquals(new Integer(attributeValue), value); }
@Test public void testGetStorageAttributeIntegerValueByNameWithDefault_5() { String attributeName = "test"; String attributeValue = "abcd"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = 2345; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByNameWithDefault_6() { String attributeName = "test"; String attributeValue = "abcd"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = null; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByNameWithDefault_7() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = 2345; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
@Test public void testGetStorageAttributeIntegerValueByNameWithDefault_8() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = null; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }