diff options
author | Jim Hahn <jrh3@att.com> | 2019-11-15 14:12:23 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-11-15 16:24:10 -0500 |
commit | e81da8dac30b0525dd0f84e3518bcc452695e224 (patch) | |
tree | 6ccae8d31f1384e144cab6ab3015a82f31f7ecb4 /models-pdp/src/test/java/org | |
parent | 94c19c4395d37147a1721c508e4ba4d18a555464 (diff) |
Support wild cards in "supported policy types"
Refactored PfConceptKey, extracting most of it into PfKeyImpl.
Added PfSearchableKey as a subclass of PfKeyImpl.
Change-Id: I524f4ce9208fc9ba09e77db4cc7dde5a21e1d7fc
Issue-ID: POLICY-2224
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-pdp/src/test/java/org')
-rw-r--r-- | models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroupTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroupTest.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroupTest.java index ad0164ad4..2d2306978 100644 --- a/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroupTest.java +++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroupTest.java @@ -36,6 +36,7 @@ import java.util.List; import org.junit.Test; import org.onap.policy.models.base.PfConceptKey; import org.onap.policy.models.base.PfReferenceKey; +import org.onap.policy.models.base.PfSearchableKey; import org.onap.policy.models.base.PfValidationResult; import org.onap.policy.models.pdp.concepts.PdpSubGroup; import org.onap.policy.models.pdp.testconcepts.DummyJpaPdpSubgroupChild; @@ -152,7 +153,7 @@ public class JpaPdpSubGroupTest { .contains("INVALID:a PDP subgroup must support at least one policy type")); testJpaPdpSubGroup.setSupportedPolicyTypes(new ArrayList<>()); - testJpaPdpSubGroup.getSupportedPolicyTypes().add(new PfConceptKey("APolicyType:1.0.0")); + testJpaPdpSubGroup.getSupportedPolicyTypes().add(new PfSearchableKey("APolicyType:1.0.0")); assertTrue(testJpaPdpSubGroup.validate(new PfValidationResult()).isOk()); assertFalse(testJpaPdpSubGroup.validate(new PfValidationResult()).toString() .contains("INVALID:a PDP subgroup must support at least one policy type")); @@ -188,7 +189,7 @@ public class JpaPdpSubGroupTest { testJpaPdpSubGroup.setProperties(null); assertTrue(testJpaPdpSubGroup.validate(new PfValidationResult()).isOk()); - List<PfConceptKey> supportedPolicyTypes = testJpaPdpSubGroup.getSupportedPolicyTypes(); + List<PfSearchableKey> supportedPolicyTypes = testJpaPdpSubGroup.getSupportedPolicyTypes(); assertNotNull(supportedPolicyTypes); testJpaPdpSubGroup.setSupportedPolicyTypes(null); assertFalse(testJpaPdpSubGroup.validate(new PfValidationResult()).isOk()); @@ -236,7 +237,7 @@ public class JpaPdpSubGroupTest { testJpaPdpSubGroup.setDesiredInstanceCount(0); assertEquals(0, testJpaPdpSubGroup.compareTo(otherJpaPdpSubGroup)); - PfConceptKey anotherPolicyType = new PfConceptKey("AnotherPolicyType", "1.0.0"); + PfSearchableKey anotherPolicyType = new PfSearchableKey("AnotherPolicyType.*", "1.0.0"); testJpaPdpSubGroup.getSupportedPolicyTypes().add(anotherPolicyType); assertNotEquals(0, testJpaPdpSubGroup.compareTo(otherJpaPdpSubGroup)); testJpaPdpSubGroup.getSupportedPolicyTypes().remove(anotherPolicyType); |