### Question:
ForceConnectorConfig extends ConnectorConfig implements Cloneable { public void setConnectionUrl(String connectionUrl) { Map<ForceConnectionProperty, String> propMap = ForceConnectorUtils.loadConnectorPropsFromUrl(connectionUrl); if (propMap == null || propMap.size() < MIN_CONN_URL_PROPS) { throw new IllegalArgumentException("The connection url (" + connectionUrl + ") must contain at least three parts. " + "It should be in the form force: } setPropsFromMap(propMap, connectionUrl); } 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 = "badConnectionUrlProvider") public void testParseBadConnectionUrl(String connectionUrl) throws Exception { ForceConnectorConfig config = new ForceConnectorConfig(); try { config.setConnectionUrl(connectionUrl); fail("ForceConnectorConfig.setConnectionUrl should have failed with bad connection url."); } catch (IllegalArgumentException expected) { if (connectionUrl != null) { assertTrue(expected.getMessage().contains(connectionUrl)); } else { assertTrue(expected.getMessage().contains("null")); } } }
@Test(dataProvider = "connectionUrlWithBadPropertyProvider") public void testParseConnectionUrlWithBadProperty(String connectionUrl, String badProperty, String badValue) throws Exception { ForceConnectorConfig config = new ForceConnectorConfig(); try { config.setConnectionUrl(connectionUrl); fail("ForceConnectorConfig.setConnectionUrl should have failed with missing property (" + badProperty + ")"); } catch (IllegalArgumentException expected) { assertTrue(expected.getMessage().contains(badProperty)); if (badValue != null) { assertTrue(expected.getMessage().contains(badValue)); } } }