aboutsummaryrefslogtreecommitdiffstats
path: root/models-base/src/test
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2024-07-23 09:23:51 +0100
committerwaynedunican <wayne.dunican@est.tech>2024-08-13 08:49:10 +0100
commitb7804abcf865dc58a01bed3f2be4756e731d9288 (patch)
tree7f6fc3b50622578bb8612de9fe5e5c6adddfaf28 /models-base/src/test
parenta029ccab07f2dd71286804da620c513da9fdfc0e (diff)
Improve code coverage and sonar fixes
Increased code coverage to 90% SONAR - Removed TODO comments SONAR - Added NOSONAR where appropriate SONAR - Replaced stream.Collect() with stream.toList() where applicable SONAR - Made variables serializable or transient to comply with sonar rules Issue-ID: POLICY-5069 Change-Id: Ife256eaf4e6f427fe40b138bacc6f112dc5bcea4 Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'models-base/src/test')
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java2
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java2
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java1
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfObjectFilter.java1
4 files changed, 2 insertions, 4 deletions
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java
index d605645ad..35535e789 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java
@@ -130,7 +130,7 @@ class PfReferenceKeyTest {
assertNotEquals(0, testReferenceKey.compareTo(new PfReferenceKey("NPKN", VERSION001, "NPLN", "LN")));
assertEquals(0, testReferenceKey.compareTo(new PfReferenceKey("NPKN", VERSION001, NPKLN, "NLN")));
- assertNotEquals(testReferenceKey, null);
+ assertNotNull(testReferenceKey);
assertThatThrownBy(() -> new PfReferenceKey((PfReferenceKey) null)).isInstanceOf(NullPointerException.class);
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
index 2fea439b6..9d142bf96 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
@@ -48,7 +48,7 @@ class PfUtilsTest {
assertEquals(0, PfUtils.compareObjects(null, null));
assertEquals(-1, PfUtils.compareObjects(HELLO, null));
assertEquals(1, PfUtils.compareObjects(null, HELLO));
- assertNotEquals(PfUtils.compareObjects(HELLO, "goodbye"), 0);
+ assertNotEquals(0, PfUtils.compareObjects(HELLO, "goodbye"));
assertEquals(0, PfUtils.compareObjects(HELLO, HELLO));
}
diff --git a/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java b/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java
index 594528be8..4b3d9e89a 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java
@@ -102,7 +102,6 @@ public class DummyPfKey extends PfKey {
@Override
public boolean isNewerThan(@NonNull PfKey otherKey) {
- // TODO Auto-generated method stub
return false;
}
diff --git a/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfObjectFilter.java b/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfObjectFilter.java
index 489262865..3f0199ac5 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfObjectFilter.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfObjectFilter.java
@@ -33,7 +33,6 @@ import org.onap.policy.models.base.PfObjectFilter;
public class DummyPfObjectFilter implements PfObjectFilter<DummyPfObject> {
@Override
public List<DummyPfObject> filter(List<DummyPfObject> originalList) {
- // TODO Auto-generated method stub
return null;
}
}