@Test
public void testValidateStorageValidatePathPrefixNotEnabled()
{

    // Create a storage entity without any attributes.
    StorageEntity storageEntity = new StorageEntity();
    storageEntity.setName(STORAGE_NAME);
    // Mock the external calls.
    when(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_VALIDATE_PATH_PREFIX)).thenReturn(S3_ATTRIBUTE_NAME_VALIDATE_PATH_PREFIX);
    when(storageHelper.getBooleanStorageAttributeValueByName(S3_ATTRIBUTE_NAME_VALIDATE_PATH_PREFIX, storageEntity, false, true)).thenReturn(false);
    // Try to call the method under test.
    try
    {
        businessObjectDataInitiateDestroyHelperServiceImpl.validateStorage(storageEntity);
        fail();
    }
    catch (IllegalStateException e)
    {
        assertEquals(String.format("Path prefix validation must be enabled on \"%s\" storage.", STORAGE_NAME), e.getMessage());
    }
    // Verify the external calls.
    verify(configurationHelper).getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_VALIDATE_PATH_PREFIX);
    verify(storageHelper).getBooleanStorageAttributeValueByName(S3_ATTRIBUTE_NAME_VALIDATE_PATH_PREFIX, storageEntity, false, true);
    verifyNoMoreInteractionsHelper();
}