diff options
Diffstat (limited to 'cadi/client/src')
-rw-r--r-- | cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java | 8 | ||||
-rw-r--r-- | cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java index 862868f0..e9e9708f 100644 --- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java +++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java @@ -25,12 +25,20 @@ import java.net.URISyntaxException; import java.util.Date; import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.cadi.config.SecurityInfoC; public class SingleEndpointLocator implements SizedLocator<URI> { private final URI uri; private final static Item item = new Item() {}; private Date noRetryUntil; + /** + * New constructor that works with the Config.loadLocator function + */ + public SingleEndpointLocator(final SecurityInfoC<?> sec, final URI uri) throws LocatorException { + this.uri = uri; + } + public SingleEndpointLocator(final URI uri) { this.uri = uri; } diff --git a/cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java b/cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java index 77213e6a..69632e57 100644 --- a/cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java +++ b/cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java @@ -22,6 +22,7 @@ package org.onap.aaf.cadi.locator.test; import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.anyOf; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; @@ -58,9 +59,9 @@ public class JU_DNSLocator { item = dl.best(); uri = dl.get(item); - assertThat(uri.toString(), is("https://localhost:8100")); + assertThat(uri.toString(), anyOf(is("https://localhost:8100"), is("https://127.0.0.1:8100"))); item = dl.best(); - assertThat(uri.toString(), is("https://localhost:8100")); + assertThat(uri.toString(), anyOf(is("https://localhost:8100"), is("https://127.0.0.1:8100"))); assertThat(dl.hasItems(), is(true)); for (item = dl.first(); item != null; item = dl.next(item)) { |