From 32f3f7ec3c8d28cb9a545936b8a47395b8a00d28 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Fri, 5 Mar 2021 09:53:05 +0000 Subject: Fix 4 newly added Sonar bugs Added casting for 4 asserts in policy/models/base Issue-ID: POLICY-3094 Change-Id: Ibc97be3eca366a7e9b8b9611bc284f2473acff6e Signed-off-by: lapentafd --- .../src/test/java/org/onap/policy/models/base/PfKeyImplTest.java | 4 ++-- .../src/test/java/org/onap/policy/models/base/PfKeyUseTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'models-base') diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java index 171077e35..54edc8710 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java @@ -165,8 +165,8 @@ public class PfKeyImplTest { assertEquals(-36, someKey0.compareTo(new DummyPfKey())); assertNotEquals(someKey0, null); - assertEquals(someKey0, someKey0); - assertNotEquals(someKey0, new DummyPfKey()); + assertEquals(someKey0, (Object) someKey0); + assertNotEquals(someKey0, (Object) new DummyPfKey()); MyKey someKey8 = new MyKey(); someKey8.setVersion(VERSION001); diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java index 1b8534433..58c872c90 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java @@ -71,9 +71,9 @@ public class PfKeyUseTest { assertNotEquals(0, keyUse.hashCode()); - assertEquals(keyUse, keyUse); + assertEquals(keyUse, (Object) keyUse); assertEquals(keyUse, clonedKeyUse); - assertNotEquals(keyUse, "Hello"); + assertNotEquals(keyUse, (Object) "Hello"); assertEquals(keyUse, new PfKeyUse(key)); assertEquals(0, keyUse.compareTo(keyUse)); -- cgit 1.2.3-korg