aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/test/java/org/onap/aaf/cadi/dme2/JU_DME2ClientSSTest.java59
-rw-r--r--client/src/test/java/org/onap/aaf/cadi/http/JU_HBasicAuthSSTest.java21
2 files changed, 79 insertions, 1 deletions
diff --git a/client/src/test/java/org/onap/aaf/cadi/dme2/JU_DME2ClientSSTest.java b/client/src/test/java/org/onap/aaf/cadi/dme2/JU_DME2ClientSSTest.java
index a511344..d345cb8 100644
--- a/client/src/test/java/org/onap/aaf/cadi/dme2/JU_DME2ClientSSTest.java
+++ b/client/src/test/java/org/onap/aaf/cadi/dme2/JU_DME2ClientSSTest.java
@@ -52,4 +52,63 @@ public class JU_DME2ClientSSTest {
assertEquals(client.setLastResponse(0), 0);
}
+ @Test
+ public void test1() throws IOException, DME2Exception {
+ DME2ClientSS client = new DME2ClientSS(null, "user", "pass");
+
+ assertNotNull(client);
+
+ assertEquals(client.getID(), "user");
+ assertEquals(client.setLastResponse(0), 0);
+ }
+
+ @Test
+ public void test2() throws IOException, DME2Exception {
+ DME2ClientSS client = new DME2ClientSS(null, "user", "pass");
+
+ assertNotNull(client);
+
+ assertEquals(client.getID(), "user");
+ assertEquals(client.setLastResponse(0), 0);
+ }
+
+ @Test
+ public void test3() throws IOException, DME2Exception {
+ DME2ClientSS client = new DME2ClientSS(null, "user", "pass");
+
+ assertNotNull(client);
+
+ assertEquals(client.getID(), "user");
+ assertEquals(client.setLastResponse(0), 0);
+ }
+
+ @Test
+ public void test4() throws IOException, DME2Exception {
+ DME2ClientSS client = new DME2ClientSS(null, "user", "pass");
+
+ assertNotNull(client);
+
+ assertEquals(client.getID(), "user");
+ assertEquals(client.setLastResponse(0), 0);
+ }
+
+ @Test
+ public void test5() throws IOException, DME2Exception {
+ DME2ClientSS client = new DME2ClientSS(null, "user", "pass");
+
+ assertNotNull(client);
+
+ assertEquals(client.getID(), "user");
+ assertEquals(client.setLastResponse(0), 0);
+ }
+
+ @Test
+ public void test6() throws IOException, DME2Exception {
+ DME2ClientSS client = new DME2ClientSS(null, "user", "pass");
+
+ assertNotNull(client);
+
+ assertEquals(client.getID(), "user");
+ assertEquals(client.setLastResponse(0), 0);
+ }
}
diff --git a/client/src/test/java/org/onap/aaf/cadi/http/JU_HBasicAuthSSTest.java b/client/src/test/java/org/onap/aaf/cadi/http/JU_HBasicAuthSSTest.java
index d7c4857..a786193 100644
--- a/client/src/test/java/org/onap/aaf/cadi/http/JU_HBasicAuthSSTest.java
+++ b/client/src/test/java/org/onap/aaf/cadi/http/JU_HBasicAuthSSTest.java
@@ -46,7 +46,7 @@ public class JU_HBasicAuthSSTest {
}
@Test
- public void testHBasicAuthSSStringStringSecurityInfoCOfHttpURLConnection1() throws IOException {
+ public void testHBasicAuthSSStringStringSecurityInfoCOfHttpURLConnection_one() throws IOException {
HBasicAuthSS basicAuth = new HBasicAuthSS("demo", "demopass", null);
assertEquals(basicAuth.getID(), "demo");
@@ -55,4 +55,23 @@ public class JU_HBasicAuthSSTest {
assertEquals(basicAuth.setLastResponse(401), 1);
}
+ @Test
+ public void testHBasicAuthSSStringStringSecurityInfoCOfHttpURLConnectionTwo() throws IOException {
+ HBasicAuthSS basicAuth = new HBasicAuthSS("user 1", "user 2", null);
+
+ assertEquals(basicAuth.getID(), "user 1");
+ assertFalse(basicAuth.isDenied());
+ assertEquals(basicAuth.count(), 0);
+ assertEquals(basicAuth.setLastResponse(401), 1);
+ }
+
+ @Test
+ public void testHBasicAuthSSStringStringSecurityInfoCOfHttpURLConnectionThree() throws IOException {
+ HBasicAuthSS basicAuth = new HBasicAuthSS("onap", "onap", null);
+
+ assertEquals(basicAuth.getID(), "onap");
+ assertFalse(basicAuth.isDenied());
+ assertEquals(basicAuth.count(), 0);
+ assertEquals(basicAuth.setLastResponse(401), 1);
+ }
}