summaryrefslogtreecommitdiffstats
path: root/controlloop/templates
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-09-28 15:27:50 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-28 15:27:50 +0000
commit400ca9b5ebb98c42c0c497d917f3cf139b03888a (patch)
treedfd8375bbb43d97242a643527849f8af3b6b3c5f /controlloop/templates
parent6700a793821cebcafe28b124b49dcabff0eb4caa (diff)
parent1f651c480d4dd3922e1c05461f7d901c47293c4a (diff)
Merge "Add missing auth headers to guard request"
Diffstat (limited to 'controlloop/templates')
-rw-r--r--controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl3
-rw-r--r--controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl1
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java3
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java8
4 files changed, 11 insertions, 4 deletions
diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl
index 343221f0d..3dc984dd2 100644
--- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl
+++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl
@@ -620,12 +620,11 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED"
// to the CallGuardTask() and set the first argument to null
// (instead of XacmlPdpEngine).
//
- boolean guardEnabled = true;
+ boolean guardEnabled = false;
if(guardEnabled){
Thread t = new Thread(new org.onap.policy.guard.CallGuardTask(
- PolicyEngine.manager.getEnvironmentProperty("guard.url"),
drools.getWorkingMemory(),
$event.closedLoopControlName,
$operation.policy.getActor().toString(),
diff --git a/controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl b/controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl
index 6976e9937..03a38e5dc 100644
--- a/controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl
+++ b/controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl
@@ -592,7 +592,6 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED"
if(guardEnabled){
Thread t = new Thread(new org.onap.policy.guard.CallGuardTask(
- "",
drools.getWorkingMemory(),
$event.closedLoopControlName,
$operation.policy.getActor().toString(),
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java
index e3b5a4fed..a6a4d3fc6 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java
@@ -60,6 +60,7 @@ public class ControlLoopXacmlGuardTest {
public static void setUpSimulator() {
try {
Util.buildAaiSim();
+ Util.buildGuardSim();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -75,7 +76,7 @@ public class ControlLoopXacmlGuardTest {
@BeforeClass
public static void setPUProp(){
System.setProperty(OPSHISTPUPROP, "TestOperationsHistoryPU");
- PolicyEngine.manager.setEnvironmentProperty("guard.url", "http://127.0.0.1:8443/pdp");
+ Util.setTestGuardProps();
}
@AfterClass
public static void restorePUProp(){
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java
index 8e8ac355c..df10714b9 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java
@@ -280,5 +280,13 @@ public final class Util {
PolicyEngine.manager.setEnvironmentProperty("so.username", "SO");
PolicyEngine.manager.setEnvironmentProperty("so.password", "SO");
}
+ public static void setTestGuardProps(){
+ 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_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");
+ }
}