diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/test/java/org/onap/aaf/cadi/JU_PropAccessTest.java | 21 | ||||
-rw-r--r-- | core/src/test/java/org/onap/aaf/cadi/lur/JU_ConfigPrincipalTest.java | 33 |
2 files changed, 54 insertions, 0 deletions
diff --git a/core/src/test/java/org/onap/aaf/cadi/JU_PropAccessTest.java b/core/src/test/java/org/onap/aaf/cadi/JU_PropAccessTest.java index 163058a..907b5e1 100644 --- a/core/src/test/java/org/onap/aaf/cadi/JU_PropAccessTest.java +++ b/core/src/test/java/org/onap/aaf/cadi/JU_PropAccessTest.java @@ -83,6 +83,27 @@ public class JU_PropAccessTest { String[] args = {"key=value1","wow=wow1"};
p = new PropAccess(args);
}
+
+ @Test
+ public void testPropAccesstwo() throws IOException {
+ PropAccess p = new PropAccess(new Object());
+
+ assertNotNull(p);
+ assertNotNull(p.getProperties());
+ assertNull(p.getProperty("everythingone"));
+
+ p.setProperty("prop12", "value12");
+ assertEquals(p.getProperty("prop12"), "value12");
+
+ p.setProperty(Config.CADI_KEYFILE, "value12");
+ assertEquals(p.getProperty("prop12"), "value12");
+
+ p.setLogLevel(Level.INFO);
+ assertTrue(p.willLog(Level.INFO));
+ p.log(Level.DEBUG, new Object());
+ String[] args = {"key=value12","wow=wow12"};
+ p = new PropAccess(args);
+ }
}
diff --git a/core/src/test/java/org/onap/aaf/cadi/lur/JU_ConfigPrincipalTest.java b/core/src/test/java/org/onap/aaf/cadi/lur/JU_ConfigPrincipalTest.java index a8a413f..ec5d0a8 100644 --- a/core/src/test/java/org/onap/aaf/cadi/lur/JU_ConfigPrincipalTest.java +++ b/core/src/test/java/org/onap/aaf/cadi/lur/JU_ConfigPrincipalTest.java @@ -135,4 +135,37 @@ public class JU_ConfigPrincipalTest { assertEquals(p.toString(), "Demo");
assertTrue(p.getAsBasicAuthHeader().startsWith("Basic"));
}
+
+ @Test
+ public void testConfigPrincipalStringByteArray5() throws IOException {
+ byte[] bytes = "password".getBytes();
+ ConfigPrincipal p = new ConfigPrincipal("Demo", bytes);
+
+ assertEquals(p.getName(), "Demo");
+ assertEquals(p.getCred(), bytes);
+ assertEquals(p.toString(), "Demo");
+ assertTrue(p.getAsBasicAuthHeader().startsWith("Basic"));
+ }
+
+ @Test
+ public void testConfigPrincipalStringByteArray6() throws IOException {
+ byte[] bytes = "password".getBytes();
+ ConfigPrincipal p = new ConfigPrincipal("Demo", bytes);
+
+ assertEquals(p.getName(), "Demo");
+ assertEquals(p.getCred(), bytes);
+ assertEquals(p.toString(), "Demo");
+ assertTrue(p.getAsBasicAuthHeader().startsWith("Basic"));
+ }
+
+ @Test
+ public void testConfigPrincipalStringByteArray7() throws IOException {
+ byte[] bytes = "password".getBytes();
+ ConfigPrincipal p = new ConfigPrincipal("Demo", bytes);
+
+ assertEquals(p.getName(), "Demo");
+ assertEquals(p.getCred(), bytes);
+ assertEquals(p.toString(), "Demo");
+ assertTrue(p.getAsBasicAuthHeader().startsWith("Basic"));
+ }
}
|