### Question:
RestClientBindings { public static Properties bind(URI fsURI, Configuration conf) throws SwiftConfigurationException { String host = fsURI.getHost(); if (host == null || host.isEmpty()) { throw invalidName(host); } String container = extractContainerName(host); String service = extractServiceName(host); String prefix = buildSwiftInstancePrefix(service); if (LOG.isDebugEnabled()) { LOG.debug("Filesystem " + fsURI + " is using configuration keys " + prefix); } Properties props = new Properties(); props.setProperty(SWIFT_SERVICE_PROPERTY, service); props.setProperty(SWIFT_CONTAINER_PROPERTY, container); copy(conf, prefix + DOT_AUTH_URL, props, SWIFT_AUTH_PROPERTY, true); copy(conf, prefix + DOT_AUTH_ENDPOINT_PREFIX, props, SWIFT_AUTH_ENDPOINT_PREFIX, true); copy(conf, prefix + DOT_USERNAME, props, SWIFT_USERNAME_PROPERTY, true); copy(conf, prefix + DOT_APIKEY, props, SWIFT_APIKEY_PROPERTY, false); copy(conf, prefix + DOT_PASSWORD, props, SWIFT_PASSWORD_PROPERTY, props.contains(SWIFT_APIKEY_PROPERTY) ? true : false); copy(conf, prefix + DOT_TRUST_ID, props, SWIFT_TRUST_ID_PROPERTY, false); copy(conf, prefix + DOT_DOMAIN_NAME, props, SWIFT_DOMAIN_NAME_PROPERTY, false); copy(conf, prefix + DOT_DOMAIN_ID, props, SWIFT_DOMAIN_ID_PROPERTY, false); copy(conf, prefix + DOT_TENANT, props, SWIFT_TENANT_PROPERTY, false); copy(conf, prefix + DOT_CONTAINER_TENANT, props, SWIFT_CONTAINER_TENANT_PROPERTY, false); copy(conf, prefix + DOT_REGION, props, SWIFT_REGION_PROPERTY, false); copy(conf, prefix + DOT_HTTP_PORT, props, SWIFT_HTTP_PORT_PROPERTY, false); copy(conf, prefix + DOT_HTTPS_PORT, props, SWIFT_HTTPS_PORT_PROPERTY, false); copyBool(conf, prefix + DOT_PUBLIC, props, SWIFT_PUBLIC_PROPERTY, false); copyBool(conf, prefix + DOT_LOCATION_AWARE, props, SWIFT_LOCATION_AWARE_PROPERTY, false); return props; }  static String buildSwiftInstancePrefix(String service); static String extractContainerName(String hostname); static String extractContainerName(URI uri); static String extractServiceName(String hostname); static String extractServiceName(URI uri); static Properties bind(URI fsURI, Configuration conf); static void copy(Configuration conf, String confKey, Properties props,
                          String propsKey,
                          boolean required); static final String E_INVALID_NAME; }### Answer:
@Test(expected = SwiftConfigurationException.class) public void testDottedServiceURL() throws Exception { RestClientBindings.bind(new URI("swift: }
@Test(expected = SwiftConfigurationException.class) public void testMissingServiceURL() throws Exception { RestClientBindings.bind(new URI("swift: }