diff options
author | liamfallon <liam.fallon@est.tech> | 2020-03-20 12:50:35 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2020-03-20 12:50:38 +0000 |
commit | 99bfdc2584c408970d9d9cdc0e8ab869dc126edb (patch) | |
tree | 82d06fc27c428539cc407aa9c8f6b9a1c022a604 /models-base | |
parent | dba4f913f6e130fa14db3b3465e922310d683cd5 (diff) |
Test cascaded multiple revision gets
This patch tests cascaded get requests with multiple revisions.
Issue-ID: POLICY-2377
Change-Id: Ie7dc849d7b930b861d38c386a9950ae7e84e2a05
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-base')
-rw-r--r-- | models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java | 2 | ||||
-rw-r--r-- | models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java index d259fa260..b94900430 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java @@ -322,7 +322,7 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex * @return conceptKeyVersion */ public Set<C> getAllNamesAndVersions(final String conceptKeyName, final String conceptKeyVersion) { - if (conceptKeyName == null || conceptKeyVersion == null) { + if (conceptKeyName == null || conceptKeyVersion == null || PfKey.NULL_KEY_VERSION.equals(conceptKeyVersion)) { return getAll(conceptKeyName, conceptKeyVersion); } else { final Set<C> returnSet = new TreeSet<>(); diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java index 600605ae1..e28fa4cdf 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java @@ -179,6 +179,8 @@ public class PfConceptContainerTest { assertEquals(conceptKey, returnSet.iterator().next().getKey()); returnSet = container.getAllNamesAndVersions(conceptKey.getName(), null); assertEquals(conceptKey, returnSet.iterator().next().getKey()); + returnSet = container.getAllNamesAndVersions(conceptKey.getName(), "0.0.0"); + assertEquals(conceptKey, returnSet.iterator().next().getKey()); returnSet = container.getAllNamesAndVersions("IDontExist", "1.0.0"); assertTrue(returnSet.isEmpty()); |