aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-XACML/src/test
diff options
context:
space:
mode:
authorKrishnajinka <kris.jinka@samsung.com>2018-08-13 15:44:55 +0900
committerKrishnajinka <kris.jinka@samsung.com>2018-08-13 21:30:22 +0900
commit84223fab05c1493df05db20016a83687bdaee975 (patch)
treed2963885a5bc5a0589b3c84f51be16114963b243 /ONAP-XACML/src/test
parent6ed1731fa2ce340d745dc2d39ffc6a066f50fbc2 (diff)
Modify std pap policy to use builder in constr
Fix sonar issue about constructor using more than 7 params. Use builder parameters object for setting the attributes of std pap policy.Rework2 Issue-ID: POLICY-1016 Change-Id: If26f7daa8d5b5d387238aad74daeddd49a8b95bb Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
Diffstat (limited to 'ONAP-XACML/src/test')
-rw-r--r--ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPAPPolicyTest.java41
1 files changed, 32 insertions, 9 deletions
diff --git a/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPAPPolicyTest.java b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPAPPolicyTest.java
index aa57c27f0..4a9370c41 100644
--- a/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPAPPolicyTest.java
+++ b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPAPPolicyTest.java
@@ -586,7 +586,7 @@ public class StdPAPPolicyTest {
.description("description")
.onapName("onapName")
.configName("configName")
- .attributes(attributes)
+ .dyanamicFieldConfigAttributes(attributes)
.configType("configType")
.configBodyData("body")
.editPolicy(true)
@@ -624,10 +624,18 @@ public class StdPAPPolicyTest {
dynamicRuleAlgorithmField1.add("dynamicRuleAlgorithmField1");
List<String> dynamicRuleAlgorithmField2 = new ArrayList<>();
dynamicRuleAlgorithmField2.add("dynamicRuleAlgorithmField2");
- StdPAPPolicy stdPAPPolicy = new StdPAPPolicy("policyName", "description", attributes,
- dynamicRuleAlgorithmLabels, dynamicRuleAlgorithmCombo, dynamicRuleAlgorithmField1,
- dynamicRuleAlgorithmField2,
- "actionPerformer", "actionAttribute", true, "domain", 1);
+ StdPAPPolicy stdPAPPolicy = new StdPAPPolicy(StdPAPPolicyParams.builder().policyName("policyName").description("description")
+ .dyanamicFieldConfigAttributes(attributes)
+ .dynamicRuleAlgorithmLabels(dynamicRuleAlgorithmLabels)
+ .dynamicRuleAlgorithmCombo(dynamicRuleAlgorithmCombo)
+ .dynamicRuleAlgorithmField1(dynamicRuleAlgorithmField1)
+ .dynamicRuleAlgorithmField2(dynamicRuleAlgorithmField2)
+ .actionPerformer("actionPerformer")
+ .actionAttribute("actionAttribute")
+ .editPolicy(true)
+ .domain("domain")
+ .highestVersion(1)
+ .build());
assertEquals("policyName", stdPAPPolicy.getPolicyName());
assertEquals("description", stdPAPPolicy.getPolicyDescription());
assertEquals(attributes, stdPAPPolicy.getDynamicFieldConfigAttributes());
@@ -664,10 +672,25 @@ public class StdPAPPolicyTest {
dynamicVariableList.add("dynamicVariableList");
List<String> dataTypeList = new ArrayList<>();
dataTypeList.add("dataTypeList");
- StdPAPPolicy stdPAPPolicy = new StdPAPPolicy("policyName", "description", "onapName", "providerComboBox",
- attributes, settings, treatments, dynamicRuleAlgorithmLabels, dynamicRuleAlgorithmCombo,
- dynamicRuleAlgorithmField1, dynamicRuleAlgorithmField2, dropDownMap, dynamicVariableList,
- dataTypeList, true, "domain", 1);
+ StdPAPPolicy stdPAPPolicy = new StdPAPPolicy(StdPAPPolicyParams.builder()
+ .policyName("policyName")
+ .description("description")
+ .onapName("onapName")
+ .providerComboBox("providerComboBox")
+ .dyanamicFieldConfigAttributes(attributes)
+ .dynamicSettingsMap(settings)
+ .treatments(treatments)
+ .dynamicRuleAlgorithmLabels(dynamicRuleAlgorithmLabels)
+ .dynamicRuleAlgorithmCombo(dynamicRuleAlgorithmCombo)
+ .dynamicRuleAlgorithmField1(dynamicRuleAlgorithmField1)
+ .dynamicRuleAlgorithmField2(dynamicRuleAlgorithmField2)
+ .dropDownMap(dropDownMap)
+ .dynamicVariableList(dynamicVariableList)
+ .dataTypeList(dataTypeList)
+ .editPolicy(true)
+ .domain("domain")
+ .highestVersion(1)
+ .build());
assertEquals("policyName", stdPAPPolicy.getPolicyName());
assertEquals("description", stdPAPPolicy.getPolicyDescription());
assertEquals("onapName", stdPAPPolicy.getOnapName());