### Question:
ForceConnectorConfig extends ConnectorConfig implements Cloneable { static ForceConnectorConfig loadFromName(String connectionName) throws IOException { Map<ForceConnectionProperty, String> propMap = ForceConnectorUtils.loadConnectorPropsFromName(connectionName); if (propMap == null) return null; ForceConnectorConfig config = new ForceConnectorConfig(); config.setPropsFromMap(propMap, connectionName); return config; } ForceConnectorConfig(); @Override void setAuthEndpoint(String authEndpoint); String getClientId(); void setClientId(String clientId); void setConnectionUrl(String connectionUrl); @Override void setTraceMessage(boolean traceMessage); @Override void setUsername(String username); @Override PrintStream getTraceStream(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test(dataProvider = "envVariableConnNameProvider") public void testLoadFromEnvVariable(String connectionName) throws Exception { ForceConnectorConfig config = ForceConnectorConfig.loadFromName(connectionName); assertNotNull(config); assertEquals(config.getAuthEndpoint(), "https: assertEquals(config.getUsername(), "user"); assertEquals(config.getPassword(), "password"); }
@Test(dataProvider = "javaPropertyProvider") public void testLoadFromJavaProperty(String propName, String connectionName) throws Exception { try { System.setProperty(propName, "force: ForceConnectorConfig config = ForceConnectorConfig.loadFromName(connectionName); assertNotNull(config); assertEquals(config.getAuthEndpoint(), "https: assertEquals(config.getUsername(), "user@org.com"); assertEquals(config.getPassword(), "password"); } finally { System.clearProperty(propName); } }
@Test public void testLoadFromJavaPropertyIsCaseSensitive() throws Exception { try { System.setProperty("force.xyz.url", "force: assertNull(ForceConnectorConfig.loadFromName("XYZ")); } finally { System.clearProperty("force.xyz.url"); } }
@Test public void testLoadJavaPropertyBeforePropertyFile() throws Exception { try { System.setProperty("force.unitconnurl.url", "force: ForceConnectorConfig config = ForceConnectorConfig.loadFromName("unitconnurl"); assertNotNull(config); assertEquals(config.getAuthEndpoint(), "https: assertEquals(config.getUsername(), "javapropuser"); assertEquals(config.getPassword(), "javaproppassword"); } finally { System.clearProperty("force.unitconnurl.url"); } }
@Test public void testLoadWithNothingSet() throws Exception { assertNull(ForceConnectorConfig.loadFromName("xyz")); }