Merge "Improve coverage of cadi-aaf"
[aaf/authz.git] / cadi / aaf / src / main / java / org / onap / aaf / cadi / aaf / v2_0 / AAFLocator.java
index 4f60eda..e7e3ef3 100644 (file)
@@ -79,15 +79,16 @@ public class AAFLocator extends AbsAAFLocator<BasicTrans>  {
                                        int slash = aaf_locator_host.lastIndexOf("//");
                                        host = aaf_locator_host.substring(slash+2);
                                }
-                               client = new HClient(ss, new URI(
-                                                                                       locatorURI.getScheme(),
-                                                                                       locatorURI.getUserInfo(),
-                                                                                       host,
-                                                                                       locatorURI.getPort(),
-                                                                                       "/locate/"+name + '/' + version,
-                                                                                       null,
-                                                                                       null
-                                                                                       ), connectTimeout);
+                               URI uri = new URI(
+                                                       locatorURI.getScheme(),
+                                                       locatorURI.getUserInfo(),
+                                                       host,
+                                                       locatorURI.getPort(),
+                                                       "/locate/"+name + '/' + version,
+                                                       null,
+                                                       null
+                                                       );
+                               client = createClient(ss, uri, connectTimeout);
                        } else {
                                client = new HClient(ss, locatorURI, connectTimeout);
                        }
@@ -129,4 +130,8 @@ public class AAFLocator extends AbsAAFLocator<BasicTrans>  {
        protected URI getURI() {
                return client.getURI();
        }
+       
+       protected HClient createClient(SecuritySetter<HttpURLConnection> ss, URI uri, int connectTimeout) throws LocatorException {
+               return new HClient(ss, uri, connectTimeout);
+       }
 }