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;
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;
@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);
@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);
}
+ @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");