aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/main/java
diff options
context:
space:
mode:
authorTej, Tarun <tt3868@att.com>2017-09-22 00:49:10 -0400
committerTej, Tarun <tt3868@att.com>2017-09-22 00:55:06 -0400
commitb0f132227b0d77ea847f40d07f57d9d053c1555e (patch)
tree5ab56d0fe8e30ef7feb96352d648339190736c9a /ONAP-PAP-REST/src/main/java
parent1b6feb8d0ca8094a0b7a552f1e3907f206be2527 (diff)
Additional Junit coverage for PAP REST
additional tests for Policy engine PAP project Issue-Id: POLICY-52 Change-Id: I9a23ca758783e8f370c82a56143b53e3c858051c Signed-off-by: Tej, Tarun <tt3868@att.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main/java')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java4
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java5
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java5
3 files changed, 12 insertions, 2 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java
index eae3e79a9..d870ca86c 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java
@@ -63,6 +63,7 @@ import org.onap.policy.xacml.api.XACMLErrorConstants;
import org.onap.policy.xacml.std.pip.engines.aaf.AAFEngine;
import org.onap.policy.xacml.util.XACMLPolicyScanner;
+import com.att.research.xacml.api.XACML3;
import com.att.research.xacml.api.pap.PAPException;
import com.att.research.xacml.std.IdentifierImpl;
@@ -423,7 +424,6 @@ public class DecisionPolicy extends Policy {
// Values for AAF Provider are here for XML Creation.
ConditionType condition = new ConditionType();
ApplyType decisionApply = new ApplyType();
- String selectedFunction = "boolean-equal";
AttributeValueType value1 = new AttributeValueType();
value1.setDataType(BOOLEAN_DATATYPE);
@@ -439,7 +439,7 @@ public class DecisionPolicy extends Policy {
innerDecisionApply.setFunctionId(FUNCTION_BOOLEAN_ONE_AND_ONLY);
innerDecisionApply.getExpression().add(new ObjectFactory().createAttributeDesignator(value2));
- decisionApply.setFunctionId(dropDownMap.get(selectedFunction));
+ decisionApply.setFunctionId(XACML3.ID_FUNCTION_BOOLEAN_EQUAL.stringValue());
decisionApply.getExpression().add(new ObjectFactory().createAttributeValue(value1));
decisionApply.getExpression().add(new ObjectFactory().createApply(innerDecisionApply));
condition.setExpression(new ObjectFactory().createApply(decisionApply));
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java
index d142a46f3..675c82549 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java
@@ -35,6 +35,7 @@ import org.json.JSONObject;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.pap.xacml.rest.adapters.GridData;
+import org.onap.policy.pap.xacml.rest.daoimpl.CommonClassDaoImpl;
import org.onap.policy.pap.xacml.rest.util.JsonMessage;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.ClosedLoopD2Services;
@@ -1042,6 +1043,10 @@ public class ClosedLoopDictionaryController{
}
return null;
}
+
+ public static void setCommonClassDao(CommonClassDaoImpl commonClassDaoImpl) {
+ commonClassDao = commonClassDaoImpl;
+ }
}
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java
index 86706d154..3a4d7b71b 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java
@@ -103,6 +103,11 @@ public class FirewallDictionaryController {
public FirewallDictionaryController(CommonClassDao commonClassDao){
FirewallDictionaryController.commonClassDao = commonClassDao;
}
+
+ public static void setCommonClassDao(CommonClassDao clDao){
+ commonClassDao = clDao;
+ }
+
/*
* This is an empty constructor
*/