Fix testing results for Authn
[aaf/authz.git] / cadi / aaf / src / main / java / org / onap / aaf / cadi / aaf / v2_0 / AAFLocator.java
index 7a98310..00a4056 100644 (file)
@@ -52,12 +52,6 @@ public class AAFLocator extends AbsAAFLocator<BasicTrans>  {
 
        public AAFLocator(SecurityInfoC<HttpURLConnection> si, URI locatorURI) throws LocatorException {
                super(si.access, nameFromLocatorURI(locatorURI), 10000L /* Wait at least 10 seconds between refreshes */);
-               SecuritySetter<HttpURLConnection> ss;
-               try {
-                       ss=AAFConHttp.bestSS(si);
-               } catch (APIException | CadiException e1) {
-                       throw new LocatorException(e1);
-               }
                synchronized(sr) {
                        if(env==null) {
                                env = new RosettaEnv(access.getProperties());
@@ -81,7 +75,7 @@ public class AAFLocator extends AbsAAFLocator<BasicTrans>  {
                                                null,
                                                null
                                                );
-                               client = createClient(ss, uri, connectTimeout);
+                               client = createClient(si.defSS, uri, connectTimeout);
                        } else if(path.length>1 && "locate".equals(path[1])) {
                                StringBuilder sb = new StringBuilder();
                                for(int i=3;i<path.length;++i) {
@@ -94,13 +88,13 @@ public class AAFLocator extends AbsAAFLocator<BasicTrans>  {
                                                        locatorURI.getUserInfo(),
                                                        locatorURI.getHost(),
                                                        locatorURI.getPort(),
-                                                       "/locate/"+name + '/' + version,
+                                                       "/locate/"+name + ':' + version,
                                                        null,
                                                        null
                                                        );
-                               client = createClient(ss, uri, connectTimeout);
+                               client = createClient(si.defSS, uri, connectTimeout);
                        } else {
-                               client = new HClient(ss, locatorURI, connectTimeout);
+                               client = new HClient(si.defSS, locatorURI, connectTimeout);
                        }
                        epsDF = env.newDataFactory(Endpoints.class);
                } catch (APIException | URISyntaxException e) {
@@ -115,7 +109,7 @@ public class AAFLocator extends AbsAAFLocator<BasicTrans>  {
                        client.send();
                        Future<Endpoints> fr = client.futureRead(epsDF, TYPE.JSON);
                        if(fr.get(client.timeout())) {
-                               List<EP> epl = new LinkedList<EP>();
+                               List<EP> epl = new LinkedList<>();
                                for(Endpoint endpoint : fr.value.getEndpoint()) {
                                        epl.add(new EP(endpoint,latitude,longitude));
                                }