package com.github.ryanbrainard.richsobjects.api.client;

/**
 * @author Ryan Brainard
 */
public class SfdcApiTestSessionProvider implements SfdcApiSessionProvider {
    
    @Override
    public String getAccessToken() {
        return System.getProperty("sfdc.test.sessionId");
    }

    @Override
    public String getApiEndpoint() {
        return System.getProperty("sfdc.test.endpoint");
    }
}

@@ -231,34 +231,33 @@
  return 
+get
 System
-.get
 Property
 (%22sfdc.t
@@ -240,32 +240,40 @@
 etSystemProperty
+OrEnvVar
 (%22sfdc.test.sess
@@ -278,16 +278,40 @@
 ssionId%22
+, %22SFDC_TEST_SESSION_ID%22
 );%0A    %7D
@@ -382,49 +382,590 @@
 urn 
+get
 System
-.getProperty(%22sfdc.test.endpoint%22);
+PropertyOrEnvVar(%22sfdc.test.endpoint%22, %22SFDC_TEST_ENDPOINT%22);%0A    %7D%0A%0A    private static String getSystemPropertyOrEnvVar(String systemProperty, String envVar) %7B%0A        if (System.getProperties().containsKey(systemProperty)) %7B%0A            return  System.getProperty(systemProperty);%0A        %7D else if (System.getenv().containsKey(envVar)) %7B%0A            return System.getenv(envVar);%0A        %7D else %7B%0A            throw new RuntimeException(%22Could not log system property %5B%22 + systemProperty + %22%5D%22 +%0A                    %22 or environment variable %5B%22 + envVar + %22%5D%22);%0A        %7D
 %0A   

Allow test session and endpoint to come from env vars