aboutsummaryrefslogtreecommitdiffstats
path: root/models-pdp/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'models-pdp/src/test/java')
-rw-r--r--models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/ModelsTest.java6
-rw-r--r--models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpGroupsTest.java5
2 files changed, 10 insertions, 1 deletions
diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/ModelsTest.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/ModelsTest.java
index 7a6c03c71..743839362 100644
--- a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/ModelsTest.java
+++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/ModelsTest.java
@@ -42,6 +42,10 @@ public class ModelsTest {
public void testPdpModels() {
final Validator validator = ValidatorBuilder.create().with(new ToStringTester()).with(new SetterTester())
.with(new GetterTester()).build();
- validator.validate(POJO_PACKAGE, new FilterPackageInfo(), new FilterClassName(PdpMessage.class.getName()));
+
+ // exclude Test classes and PdpMessage
+ validator.validate(POJO_PACKAGE, new FilterPackageInfo(),
+ new FilterClassName("^((?!Test$).)*$"),
+ new FilterClassName("^((?!" + PdpMessage.class.getName() + ").)*$"));
}
}
diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpGroupsTest.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpGroupsTest.java
index 22e178da2..e0fafc18d 100644
--- a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpGroupsTest.java
+++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpGroupsTest.java
@@ -82,6 +82,11 @@ public class PdpGroupsTest {
groupX.setName(null);
groups.setGroups(Arrays.asList(group1, groupX));
assertInvalid(groups);
+
+ // duplicate groups
+ groups = new PdpGroups();
+ groups.setGroups(Arrays.asList(group1, group2, group1));
+ assertInvalid(groups);
}
private void assertInvalid(PdpGroups groups) {