diff options
author | liamfallon <liam.fallon@est.tech> | 2019-04-05 21:19:37 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2019-04-05 21:19:37 +0000 |
commit | 52229882d7ee3e934641de0bd2df74ed1268130e (patch) | |
tree | ddc60f59d53d0cc9136bf0e07467393b93d6f41b /models-base/src/main/java/org/onap | |
parent | 3f51a8aba42c15ba84296b6477597499bec49322 (diff) |
Add unit tests for models-base
Brings coverage in models-base up over 99%
Issue-ID: POLICY-1095
Change-Id: Ie1c9f3f132715275f44f349a415a8bb34a0115c9
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-base/src/main/java/org/onap')
-rw-r--r-- | models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java | 3 | ||||
-rw-r--r-- | models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java | 2 |
2 files changed, 4 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 e197e13a4..65a28cffe 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 @@ -170,6 +170,9 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex if (incomingConceptEntry.getValue().getVersion() != null) { conceptKey.setVersion(incomingConceptEntry.getValue().getVersion()); } + else { + conceptKey.setVersion(PfKey.NULL_KEY_VERSION); + } // After all that, save the map entry conceptMap.put(conceptKey, jpaConcept); diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java b/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java index a377c24be..0fca00d39 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java @@ -59,7 +59,7 @@ public interface PfObjectFilter<T extends Comparable<T>> { * @return the filtered list */ public default List<T> latestVersionFilter(final List<T> originalList) { - List<T> filteredList = new ArrayList<>(); + List<T> filteredList = new ArrayList<>(originalList); Collections.sort(filteredList); List<T> filteredOutList = new ArrayList<>(); |