More junits for PDP-REST
[policy/engine.git] / ONAP-PDP-REST / src / test / java / org / onap / policy / pdp / rest / XACMLPdpServletTest.java
index 3f01f0f..8c7fd7e 100644 (file)
@@ -20,6 +20,9 @@
 
 package org.onap.policy.pdp.rest;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -44,6 +47,7 @@ import org.onap.policy.common.ia.DbDAO;
 import org.onap.policy.common.ia.IntegrityAuditProperties;
 import org.onap.policy.common.im.IntegrityMonitor;
 import org.onap.policy.common.im.IntegrityMonitorException;
+import org.onap.policy.common.logging.ONAPLoggingContext;
 import org.onap.policy.common.logging.flexlogger.FlexLogger;
 import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.policy.rest.XACMLRestProperties;
@@ -202,14 +206,12 @@ public class XACMLPdpServletTest extends TestCase{
 
        @Test
        public void testUebNotification() {
-               System.out.println("drewtest1");
-               LOGGER.info("XACMLPdpServletTest - drewTest1");
+               LOGGER.info("XACMLPdpServletTest - testUebNotification");
                try {   
 
                        XACMLProperties.reloadProperties();
                        System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME, "src/test/resources/xacml.pdp.ueb.properties");
                        XACMLProperties.getProperties();
-                       XACMLProperties.setProperty(XACMLRestProperties.PROP_NOTIFICATION_TYPE, "ueb");
 
                   pdpServlet.init(servletConfig);
 
@@ -228,14 +230,12 @@ public class XACMLPdpServletTest extends TestCase{
 
        @Test
        public void testDmaapNotification() {
-               System.out.println("drewtest2");
-               LOGGER.info("XACMLPdpServletTest - drewTest2");
+               LOGGER.info("XACMLPdpServletTest - testDmaapNotification");
                try {   
                        
                        XACMLProperties.reloadProperties();
                        System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME, "src/test/resources/xacml.pdp.dmaap.properties");
                        XACMLProperties.getProperties();
-                       XACMLProperties.setProperty(XACMLRestProperties.PROP_NOTIFICATION_TYPE, "dmaap");
                
                        pdpServlet.init(servletConfig);
 
@@ -253,6 +253,21 @@ public class XACMLPdpServletTest extends TestCase{
        }
        
 
+       @Test
+       public void testXACMLPdpRegisterThread() {
+               LOGGER.info("XACMLPdpServletTest - testXACMLPdpRegisterThread");
+               try {
+                       ONAPLoggingContext baseLoggingContext = new ONAPLoggingContext();
+                       baseLoggingContext.setServer("localhost");
+                       XACMLPdpRegisterThread regThread = new XACMLPdpRegisterThread(baseLoggingContext);
+                       regThread.run();
+                       assertTrue(true);
+               } catch (Exception e) {
+                       LOGGER.error("Exception Occured"+e);
+                       fail();
+               }
+       }
+       
        @Test
        public void testDoGetNoTypeError(){
                LOGGER.info("XACMLPdpServletTest - testDoGetNoTypeError");