From c5aaaeeb8a4c008fa4a576c55da4c3bf703acdac Mon Sep 17 00:00:00 2001 From: Instrumental Date: Wed, 4 Sep 2019 19:41:24 -0500 Subject: K8s doesn't necessarily support DNS Issue-ID: AAF-963 Change-Id: I65248837fc217b0ccc09f2afe02e14c716ca5bcc Signed-off-by: Instrumental --- .../onap/aaf/cadi/locator/test/JU_DNSLocator.java | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'cadi/client/src/test/java') 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 dfc7142a..b786cf68 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 @@ -21,17 +21,20 @@ package org.onap.aaf.cadi.locator.test; -import static org.junit.Assert.*; -import static org.hamcrest.CoreMatchers.*; -import org.junit.*; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.net.URI; +import org.junit.Before; +import org.junit.Test; +import org.onap.aaf.cadi.Access.Level; +import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.LocatorException; import org.onap.aaf.cadi.PropAccess; -import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.locator.DNSLocator; public class JU_DNSLocator { @@ -73,12 +76,20 @@ public class JU_DNSLocator { new DNSLocator(access, "https", "localhost", "8100"); new DNSLocator(access, "https", "localhost", "8100-8101"); - new DNSLocator(access, "http:localhost"); - new DNSLocator(access, "https:localhost"); - new DNSLocator(access, "https:localhost:8100"); - new DNSLocator(access, "https:localhost:[8100]"); - new DNSLocator(access, "https:localhost:[8100-8101]"); - new DNSLocator(access, "https:localhost:8000/"); + new DNSLocator(access, "http://localhost"); + new DNSLocator(access, "https://localhost"); + new DNSLocator(access, "https://localhost:8100"); + new DNSLocator(access, "https://localhost:[8100]"); + new DNSLocator(access, "https://localhost:[8100-8101]"); + new DNSLocator(access, "https://localhost:8000/"); + new DNSLocator(access, "https://aaf-locatexx.onapxxx:8095/locate"); + try { + new DNSLocator(access, "https:localhost:8000"); + fail("Invalid URL should not pass"); + } catch (LocatorException e) { + access.log(Level.DEBUG, "Valid Exception"); + + } } @Test -- cgit 1.2.3-korg