summaryrefslogtreecommitdiffstats
path: root/models-pdp/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-04-13 20:26:33 -0400
committerJim Hahn <jrh3@att.com>2019-04-13 20:37:25 -0400
commitddd8b56d7bce562a9990199af9bfe36be4c2ca56 (patch)
tree4ee45c06a721f10dc2e1037851f788c6ded9c800 /models-pdp/src/main
parentc38fcf1a16f0d6bfdf2d80efa64a94ae68d80f03 (diff)
Disallow empty subgroup list in group request
Change-Id: I8a00caf1b22363fe3ab90bdf57244af687a2cb6d Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-pdp/src/main')
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
index 49dfd6fbb..4cb0ac54e 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
@@ -89,6 +89,11 @@ public class PdpGroup implements PfNameVersion, Comparable<PdpGroup> {
result.validateNotNull("name", name);
result.validateNotNullList("pdpSubgroups", pdpSubgroups, PdpSubGroup::validatePapRest);
+ if (pdpSubgroups != null && pdpSubgroups.isEmpty()) {
+ result.addResult(new ObjectValidationResult("pdpSubgroups", pdpSubgroups, ValidationStatus.INVALID,
+ "is empty"));
+ }
+
checkDuplicateSubgroups(result);
return result;