diff options
author | Jim Hahn <jrh3@att.com> | 2020-08-25 12:30:29 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-08-25 14:28:02 -0400 |
commit | 59f4f54cdf4c1a5c155360239272da690e8c4a72 (patch) | |
tree | 47fc9d91bb83b62f429e1ae8b1587c314f710f41 /models-interactions/model-impl/appc/src | |
parent | 43aaa62cdf9a7dadfb6d688f1fe83c5bd355a86d (diff) |
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 <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/appc/src')
4 files changed, 8 insertions, 20 deletions
diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java index 3e84a3df2..30d4ed910 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java @@ -83,13 +83,10 @@ public class CommonHeaderTest { copiedCommonHeader.setSubRequestId(commonHeader.getSubRequestId()); copiedCommonHeader.setTimeStamp(commonHeader.getTimeStamp()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(commonHeader, commonHeader); // NOSONAR + assertEquals(commonHeader, (Object) commonHeader); assertEquals(commonHeader, copiedCommonHeader); assertNotEquals(commonHeader, null); - assertNotEquals(commonHeader, "Hello"); // NOSONAR + assertNotEquals(commonHeader, (Object) "Hello"); CommonHeader clonedCommonHeader = new CommonHeader(commonHeader); clonedCommonHeader.setApiVer(commonHeader.getApiVer()); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java index 7d804c869..43686a747 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java @@ -72,13 +72,10 @@ public class RequestTest { copiedRequest.setPayload(request.getPayload()); copiedRequest.setTargetId(request.getTargetId()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(request, request); // NOSONAR + assertEquals(request, (Object) request); assertEquals(request, copiedRequest); assertNotEquals(request, null); - assertNotEquals(request, "Hello"); // NOSONAR + assertNotEquals(request, (Object) "Hello"); request.setCommonHeader(null); assertNotEquals(request, copiedRequest); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java index ce8b2148d..c79062594 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java @@ -55,13 +55,10 @@ public class ResponseStatusTest { copiedStatus.setDescription(status.getDescription()); copiedStatus.setValue(status.getValue()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(status, status); // NOSONAR + assertEquals(status, (Object) status); assertEquals(status, copiedStatus); assertNotEquals(status, null); - assertNotEquals(status, "Hello"); // NOSONAR + assertNotEquals(status, (Object) "Hello"); status.setCode(-1); assertNotEquals(status, copiedStatus); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java index 14e14f0f9..9e20331f9 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java @@ -67,13 +67,10 @@ public class ResponseTest { copiedResponse.setStatus(response.getStatus()); copiedResponse.setPayload(response.getPayload()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(response, response); // NOSONAR + assertEquals(response, (Object) response); assertEquals(response, copiedResponse); assertNotEquals(response, null); - assertNotEquals(response, "Hello"); // NOSONAR + assertNotEquals(response, (Object) "Hello"); response.setCommonHeader(null); assertNotEquals(response, copiedResponse); |