summaryrefslogtreecommitdiffstats
path: root/ONAP-REST/src/main
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-11-27 11:10:04 +0000
committerliamfallon <liam.fallon@est.tech>2019-11-27 11:10:10 +0000
commit35f44d97d569ef4da46d17c30cae71e75bcfe0c9 (patch)
treebe681ec3af44c4f7f8f9eb7676bb05e8784e0dfa /ONAP-REST/src/main
parent9bad71c7150ea6f94b2a08b68f356b4ee96c3d66 (diff)
Unit/SONAR/Checkstyle in ONAP-REST
Util package of ONAP-REST, with JUnit added and SONAR/Checkstyle issues addressed. Coverage increased from 18% to 31% in large PolicyValidation class. Issue-ID: POLICY-2131 Change-Id: Ie059db312918021683fe27cc2aaeed86b04046f2 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'ONAP-REST/src/main')
-rw-r--r--ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java1
-rw-r--r--ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java5
2 files changed, 4 insertions, 2 deletions
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java
index 5b596be45..b18572574 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java
@@ -202,7 +202,6 @@ public class MsModelUtils {
processXmiEpackage(file);
}
return classMap;
-
}
/**
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java
index 6bab919ad..adb8995c5 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java
@@ -47,6 +47,8 @@ import javax.json.JsonObject;
import javax.json.JsonReader;
import javax.json.JsonValue;
+import lombok.Getter;
+
import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
@@ -113,6 +115,7 @@ public class PolicyValidation {
private static Map<String, String> jsonRequestMap = new HashMap<>();
private static List<String> modelRequiredFieldsList = new ArrayList<>();
+ @Getter
private static CommonClassDao commonClassDao;
private Set<String> allReqTrueKeys = new HashSet<>();
@@ -230,7 +233,7 @@ public class PolicyValidation {
// Decision Policy Attributes Validation
if (!"API".equals(policyData.getApiflag()) && policyData.getSettings() != null
&& !policyData.getSettings().isEmpty()) {
- for (Object attribute : policyData.getAttributes()) {
+ for (Object attribute : policyData.getSettings()) {
if (attribute instanceof LinkedHashMap<?, ?>) {
String value = null;
if (((LinkedHashMap<?, ?>) attribute).get("key") == null) {