@Test
public void testGetStorageAttributeValueByNameFromStorage()
{

    final String testStorageName = "MY_TEST_STORAGE";
    final String testAttributeNameNoExists = "I_DO_NOT_EXIST";
    Storage testStorage = new Storage();
    testStorage.setName(testStorageName);
    testStorage.setAttributes(businessObjectDefinitionServiceTestHelper.getNewAttributes());
    assertEquals(ATTRIBUTE_VALUE_1, storageHelper.getStorageAttributeValueByName(ATTRIBUTE_NAME_1_MIXED_CASE, testStorage, Boolean.FALSE));
    assertEquals(ATTRIBUTE_VALUE_2, storageHelper.getStorageAttributeValueByName(ATTRIBUTE_NAME_2_MIXED_CASE, testStorage, Boolean.TRUE));
    // Testing attribute name case insensitivity.
    assertEquals(ATTRIBUTE_VALUE_1, storageHelper.getStorageAttributeValueByName(ATTRIBUTE_NAME_1_MIXED_CASE.toLowerCase(), testStorage, Boolean.TRUE));
    assertEquals(ATTRIBUTE_VALUE_1, storageHelper.getStorageAttributeValueByName(ATTRIBUTE_NAME_1_MIXED_CASE.toUpperCase(), testStorage, Boolean.TRUE));
    assertNull(storageHelper.getStorageAttributeValueByName(testAttributeNameNoExists, testStorage, Boolean.FALSE));
    // Try to get a required attribute value what does not exist.
    try
    {
        storageHelper.getStorageAttributeValueByName(testAttributeNameNoExists, testStorage, Boolean.TRUE);
        fail("Suppose to throw a RuntimeException when required storage attribute does not exist or has a blank value.");
    }
    catch (RuntimeException e)
    {
        assertEquals(String.format("Attribute \"%s\" for \"%s\" storage must be configured.", testAttributeNameNoExists, testStorage.getName()),
            e.getMessage());
    }
}