diff options
author | liamfallon <liam.fallon@est.tech> | 2019-11-28 16:28:27 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2019-11-28 16:28:36 +0000 |
commit | c93be26e9a39501d260a70e4f2d6dbe95e8f5061 (patch) | |
tree | 027c80375e311c7942ca14af0e4f91a70b0e1c5a /ONAP-REST/src/main/java/org | |
parent | 35f44d97d569ef4da46d17c30cae71e75bcfe0c9 (diff) |
Unit/SONAR/Checkstyle in ONAP-REST
Util package of ONAP-REST, with JUnit added and
SONAR/Checkstyle issues addressed. Coverage increased from 31% to 51% in
large PolicyValidation class.
Issue-ID: POLICY-2131
Change-Id: Ic88dd0d47bc9c09ed294ea62c37c683297b590c0
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'ONAP-REST/src/main/java/org')
-rw-r--r-- | ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java | 10 |
1 files changed, 3 insertions, 7 deletions
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 adb8995c5..e8c0b55a3 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 @@ -378,15 +378,11 @@ public class PolicyValidation { valid = false; } } else if ("PROPERTIES".equals(configType)) { - if (!PolicyUtils.isPropValid(configBodyData) || "".equals(configBodyData)) { + if (!PolicyUtils.isPropValid(configBodyData)) { responseString.append( "Config Body: Property data is not valid" + HTML_ITALICS_LNBREAK); valid = false; } - } else if ("OTHER".equals(configType) && ("".equals(configBodyData))) { - responseString.append( - "Config Body: Config Body Should not be Empty" + HTML_ITALICS_LNBREAK); - valid = false; } } } else { @@ -490,7 +486,7 @@ public class PolicyValidation { } } else { responseString.append( - "<b>D2/Virtualized Services</b>:<i>Select atleast one D2/Virtualized Services" + "<b>D2/Virtualized Services</b>:<i>Select at least one D2/Virtualized Services" + HTML_ITALICS_LNBREAK); valid = false; } @@ -606,7 +602,7 @@ public class PolicyValidation { } } else { responseString.append( - "<b>D2/Virtualized Services</b>: <i>Select atleast one D2/Virtualized Services" + "<b>D2/Virtualized Services</b>: <i>Select at least one D2/Virtualized Services" + HTML_ITALICS_LNBREAK); responseString.append( "<b>vPRO Actions</b>: <i>vPRO Actions is required" + HTML_ITALICS_LNBREAK); |