diff options
author | waynedunican <wayne.dunican@est.tech> | 2024-07-23 09:23:51 +0100 |
---|---|---|
committer | waynedunican <wayne.dunican@est.tech> | 2024-08-13 08:49:10 +0100 |
commit | b7804abcf865dc58a01bed3f2be4756e731d9288 (patch) | |
tree | 7f6fc3b50622578bb8612de9fe5e5c6adddfaf28 /models-interactions/model-impl/sdnr/src/test/java/org/onap | |
parent | a029ccab07f2dd71286804da620c513da9fdfc0e (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-interactions/model-impl/sdnr/src/test/java/org/onap')
7 files changed, 7 insertions, 12 deletions
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java index 1885ed124..d852e8bda 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java @@ -80,7 +80,7 @@ class PciCommonHeaderTest { assertEquals(commonHeader, (Object) commonHeader); assertEquals(commonHeader, copiedPciCommonHeader); - assertNotEquals(commonHeader, null); + assertNotNull(commonHeader); assertNotEquals(commonHeader, (Object) "Hello"); PciCommonHeader clonedPciCommonHeader = new PciCommonHeader(commonHeader); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java index 1334fcc42..00eb694e8 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java @@ -61,7 +61,7 @@ class PciRequestTest { assertEquals(request, (Object) request); assertEquals(request, copiedPciRequest); - assertNotEquals(request, null); + assertNotNull(request); assertNotEquals(request, (Object) "Hello"); request.setCommonHeader(null); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java index 722c081d4..a4a3e45b0 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java @@ -54,7 +54,7 @@ class PciRequestWrapperTest { assertEquals(requestWrapper, (Object) requestWrapper); assertEquals(requestWrapper, copiedPciRequestWrapper); - assertNotEquals(requestWrapper, null); + assertNotNull(requestWrapper); assertNotEquals(requestWrapper, (Object) "Hello"); requestWrapper.setBody(null); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java index 70480b1f7..d2e28fd68 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java @@ -67,8 +67,7 @@ class PciResponseTest { @Test void testEqualsObject() { PciResponse response = new PciResponse(); - assertEquals(response, response); - assertNotEquals(response, null); + assertNotNull(response); assertNotEquals(response, new Object()); PciResponse response2 = new PciResponse(); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java index 1b0247336..a34d65c9d 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java @@ -50,17 +50,13 @@ class PciResponseWrapperTest { copiedPciResponseWrapper.setBody(responseWrapper.getBody()); assertEquals(responseWrapper, (Object) responseWrapper); - //assertEquals(responseWrapper, copiedPciResponseWrapper); - assertNotEquals(responseWrapper, null); + assertNotNull(responseWrapper); assertNotEquals(responseWrapper, (Object) "Hello"); responseWrapper.setBody(null); assertNotEquals(responseWrapper, copiedPciResponseWrapper); copiedPciResponseWrapper.setBody(null); - //assertEquals(responseWrapper, copiedPciResponseWrapper); responseWrapper.setBody(response); - //assertNotEquals(responseWrapper, copiedPciResponseWrapper); copiedPciResponseWrapper.setBody(response); - //assertEquals(responseWrapper, copiedPciResponseWrapper); } } diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java index e8f779edb..495fc133f 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java @@ -52,7 +52,7 @@ class PciStatusTest { assertEquals(status, (Object) status); assertEquals(status, copiedStatus); - assertNotEquals(status, null); + assertNotNull(status); assertNotEquals(status, (Object) "Hello"); status.setCode(-1); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java index 8e915c3e9..3c11c0966 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java @@ -71,7 +71,7 @@ class PciWrapperTest { assertEquals(wrapper, (Object) wrapper); assertEquals(wrapper, copiedPciWrapper); - assertNotEquals(wrapper, null); + assertNotNull(wrapper); assertNotEquals(wrapper, (Object) "Hello"); checkField(VERSION_19, PciWrapper::setVersion); |