Improve coverage of cadi-core
[aaf/authz.git] / cadi / core / src / test / java / org / onap / aaf / cadi / config / test / JU_SecurityInfo.java
index c442e6f..001d0fe 100644 (file)
 
 package org.onap.aaf.cadi.config.test;
 
-import static org.junit.Assert.*;
-import static org.hamcrest.CoreMatchers.*;
-import static org.mockito.Mockito.*;
-import org.junit.*;
-import org.mockito.*;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -95,6 +97,9 @@ public class JU_SecurityInfo {
                assertNotNull(si.getSSLSocketFactory());
                assertNotNull(si.getSSLContext());
                assertNotNull(si.getKeyManagers());
+               
+               access.setProperty(Config.CADI_TRUST_MASKS, "123.123.123.123");
+               si = new SecurityInfo(access);
        }
 
        @Test(expected = CadiException.class)
@@ -110,6 +115,14 @@ public class JU_SecurityInfo {
                @SuppressWarnings("unused")
                SecurityInfo si = new SecurityInfo(access);
        }
+       
+       
+       @Test(expected = NumberFormatException.class)
+       public void badTrustMaskTest() throws CadiException {
+               access.setProperty(Config.CADI_TRUST_MASKS, "trustMask");
+               @SuppressWarnings("unused")
+               SecurityInfo si = new SecurityInfo(access);
+       }
 
        @Test
        public void coverageTest() throws CadiException {