diff options
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()); |