diff options
Diffstat (limited to 'policy-utils')
-rw-r--r-- | policy-utils/pom.xml | 2 | ||||
-rw-r--r-- | policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/policy-utils/pom.xml b/policy-utils/pom.xml index 14832417..319711a1 100644 --- a/policy-utils/pom.xml +++ b/policy-utils/pom.xml @@ -45,7 +45,7 @@ <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-configuration2</artifactId> - <version>2.8.0</version> + <version>2.11.0</version> </dependency> <dependency> <groupId>org.onap.policy.common</groupId> diff --git a/policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java b/policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java index ee32cb2b..f8ffa503 100644 --- a/policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java +++ b/policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java @@ -71,6 +71,9 @@ class DomainMakerTest { policy.setType("policy.type.Z"); assertFalse(domainMaker.isConformant(policy)); + + assertThatThrownBy(() -> domainMaker.isConformant(null)) + .hasMessageContaining("policy is marked non-null but is null"); } @Test @@ -108,6 +111,12 @@ class DomainMakerTest { domainAPolicy.getProperties().getNested().setNested1(""); ToscaConceptIdentifier ident1 = policy1.getTypeIdentifier(); assertFalse(domainMaker.conformance(ident1, domainAPolicy)); + + var policy2 = getToscaPolicy("src/test/resources/policyA.json"); + policy2.setType("not.registered.type"); + policy2.setTypeVersion("4.2.5"); + assertFalse(domainMaker.conformance(policy2)); + assertFalse(domainMaker.conformance(policy2.getTypeIdentifier(), domainAPolicy)); } @Test @@ -125,6 +134,8 @@ class DomainMakerTest { policy.setTypeVersion("1.0.0"); assertFalse(domainMaker.isConformant(policy)); + + assertFalse(domainMaker.registerValidator(policy.getTypeIdentifier(), "$schema")); } @Test |