package com.microsoft.azure.services.blob;

import org.junit.Before;
import org.junit.BeforeClass;

import com.microsoft.azure.configuration.Configuration;

public abstract class IntegrationTestBase {
    protected Configuration createConfiguration() {
        Configuration config = new Configuration();
        config.setProperty(BlobConfiguration.ACCOUNT_NAME, "xxx");
        config.setProperty(BlobConfiguration.ACCOUNT_KEY, "xxx");
        config.setProperty(BlobConfiguration.URL, "http://xxx.blob.core.windows.net");

        // when mock running
        // config.setProperty("serviceBus.uri", "http://localhost:8086");
        // config.setProperty("wrapClient.uri",
        // "http://localhost:8081/WRAPv0.9");

        return config;
    }

    @BeforeClass
    public static void initializeSystem() {
        System.out.println("initialize");
        // System.setProperty("http.proxyHost", "itgproxy");
        // System.setProperty("http.proxyPort", "80");
        // System.setProperty("http.keepAlive", "false");
    }

    @Before
    public void initialize() throws Exception {
        System.out.println("initialize");
        // System.setProperty("http.proxyHost", "itgproxy");
        // System.setProperty("http.proxyPort", "80");
        // System.setProperty("http.keepAlive", "false");
    }
}

@@ -37,16 +37,39 @@
 .blob;%0A%0A
+import java.util.Map;%0A%0A
 import o
@@ -329,35 +329,95 @@
         
-config.setProperty(
+Map%3CString, String%3E env = System.getenv();%0A        setConfigValue(config, env, 
 BlobConf
@@ -456,35 +456,44 @@
         
-c
+setC
 onfig
-.setProperty(
+Value(config, env, 
 BlobConf
@@ -531,35 +531,44 @@
         
-c
+setC
 onfig
-.setProperty(
+Value(config, env, 
 BlobConf
@@ -840,32 +840,296 @@
  config;%0A    %7D%0A%0A
+    private void setConfigValue(Configuration config, Map%3CString, String%3E props, String key, String defaultValue) %7B%0A        String value = props.get(key);%0A        if (value == null)%0A            value = defaultValue;%0A%0A        config.setProperty(key, value);%0A    %7D%0A%0A
     @BeforeClass

Support configuring integration tests with env. variables