From 59f4f54cdf4c1a5c155360239272da690e8c4a72 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 25 Aug 2020 12:30:29 -0400 Subject: Address more sonar issues in policy-models Addressed sonar issues: - diamond operator Also removed a number of the "NOSONAR" comments now that we know how to address them without disabling sonar. Issue-ID: POLICY-2714 Change-Id: I440f4fa955968fd911616c2b6ee61b4b4d013821 Signed-off-by: Jim Hahn --- .../src/test/java/org/onap/policy/so/SoRequestDetailsTest.java | 2 +- .../test/java/org/onap/policy/so/SoResponseWrapperTest.java | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'models-interactions/model-impl/so') diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java index f7b663e4b..43d5cd38a 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java @@ -113,7 +113,7 @@ public class SoRequestDetailsTest { SoRequestDetails copiedDetails = new SoRequestDetails(details); - assertEquals(details, details); + assertEquals(details, (Object) details); assertEquals(details, copiedDetails); assertNotEquals(details, null); assertNotEquals(details, (Object) "Hello"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java index e508c44f8..42f57c7e4 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java @@ -72,16 +72,10 @@ public class SoResponseWrapperTest { SoResponseWrapper identicalResponseWrapper = new SoResponseWrapper(response, requestId); - /* - * Disabling sonar because we are purposely checking various branches of the - * equals() method. - */ - assertEquals(responseWrapper, responseWrapper); // NOSONAR + assertEquals(responseWrapper, (Object) responseWrapper); assertEquals(responseWrapper, identicalResponseWrapper); - assertNotEquals(null, responseWrapper); - assertNotEquals("Hello", responseWrapper); // NOSONAR assertNotEquals(responseWrapper, null); - assertNotEquals(responseWrapper, "AString"); // NOSONAR + assertNotEquals(responseWrapper, (Object) "AString"); assertEquals(new SoResponseWrapper(null, null), new SoResponseWrapper(null, null)); assertNotEquals(new SoResponseWrapper(null, null), identicalResponseWrapper); -- cgit 1.2.3-korg