Add Unit Tests
[holmes/common.git] / holmes-actions / src / test / java / org / onap / holmes / common / dcae / DcaeConfigurationsCacheTest.java
index cb071d3..d1a3dcb 100644 (file)
@@ -16,6 +16,7 @@
 package org.onap.holmes.common.dcae;
 
 import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.nullValue;
 import static org.junit.Assert.*;
 
 import org.junit.Test;
@@ -39,4 +40,15 @@ public class DcaeConfigurationsCacheTest {
         assertThat(DcaeConfigurationsCache.getPubSecInfo("test").getAafUsername(),
                 equalTo(securityInfo.getAafUsername()));
     }
+
+    @Test
+    public void testDcaeConfigurationCacheNull() {
+        DcaeConfigurationsCache.setDcaeConfigurations(null);
+        assertThat(DcaeConfigurationsCache.getPubSecInfo("test"), nullValue());
+    }
+
+    @Test
+    public void testAddPubSecInfo() {
+        DcaeConfigurationsCache.addPubSecInfo("test", new SecurityInfo());
+    }
 }
\ No newline at end of file