From 002248883ff9134cd66e39147c062ad3936e1a74 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Fri, 3 May 2019 08:40:34 -0400 Subject: Change guard pdp rest to new api The guard PDP REST call must be changed to support the new api. Needed to clean out quite a bit of unnecessary code. In addition, there never should be an Indeterminate response coming back anymore. Issue-ID: POLICY-1730 Change-Id: I14b3ad39a803646cfffaba9b77cc2aac79e79bdf Signed-off-by: Pamela Dragosh --- .../org/onap/policy/template/demo/CcvpnBwControlLoopTest.java | 4 +++- .../org/onap/policy/template/demo/CcvpnControlLoopTest.java | 10 ++++++---- .../test/java/org/onap/policy/template/demo/SupportUtil.java | 5 +---- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'controlloop/templates') diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnBwControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnBwControlLoopTest.java index 395ecc234..0ac9c48df 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnBwControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnBwControlLoopTest.java @@ -73,6 +73,7 @@ public class CcvpnBwControlLoopTest implements TopicListener { /* Set environment properties */ SupportUtil.setAaiProps(); SupportUtil.setSdncProps(); + SupportUtil.setGuardProps(); LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "INFO"); } @@ -102,6 +103,7 @@ public class CcvpnBwControlLoopTest implements TopicListener { try { SupportUtil.buildAaiSim(); SupportUtil.buildSdncSim(); + SupportUtil.buildGuardSim(); } catch (Exception e) { fail(e.getMessage()); } @@ -370,4 +372,4 @@ public class CcvpnBwControlLoopTest implements TopicListener { logger.debug("FACT: " + handle); } } -} \ No newline at end of file +} diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java index aa447ccd0..c546248f2 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java @@ -72,6 +72,7 @@ public class CcvpnControlLoopTest implements TopicListener { /* Set environment properties */ SupportUtil.setAaiProps(); SupportUtil.setSdncProps(); + SupportUtil.setGuardProps(); LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "INFO"); } @@ -101,6 +102,7 @@ public class CcvpnControlLoopTest implements TopicListener { try { SupportUtil.buildAaiSim(); SupportUtil.buildSdncSim(); + SupportUtil.buildGuardSim(); } catch (Exception e) { fail(e.getMessage()); } @@ -158,7 +160,7 @@ public class CcvpnControlLoopTest implements TopicListener { sendEvent(pair.first); kieSession.fireUntilHalt(); - + // allow object clean-up kieSession.fireAllRules(); @@ -204,7 +206,7 @@ public class CcvpnControlLoopTest implements TopicListener { kieSession.insert(event); kieSession.fireUntilHalt(); - + // allow object clean-up kieSession.fireAllRules(); @@ -331,7 +333,7 @@ public class CcvpnControlLoopTest implements TopicListener { /** * This method is used to simulate event messages from DCAE that start the control loop (onset * message) or end the control loop (abatement message). - * + * * @param policy the controlLoopName comes from the policy */ protected void sendEvent(ControlLoopPolicy policy) { @@ -355,7 +357,7 @@ public class CcvpnControlLoopTest implements TopicListener { /** * Dumps the kie session facts. - * + * * @param kieSession input session */ public static void dumpFacts(KieSession kieSession) { diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/SupportUtil.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/SupportUtil.java index 3091656c0..493ab9b2c 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/SupportUtil.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/SupportUtil.java @@ -319,12 +319,9 @@ public final class SupportUtil { /* * Guard PDP-x connection Properties */ - PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_URL, "http://localhost:6669/pdp/api/getDecision"); + PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_URL, "http://localhost:6669/policy/pdpx/v1/decision"); PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_USER, "python"); PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_PASS, "test"); - PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_CLIENT_USER, "python"); - PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_CLIENT_PASS, "test"); - PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_ENV, "TEST"); PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_DISABLED, "false"); } -- cgit 1.2.3-korg