summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/sdnr/src/test/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-08-25 12:30:29 -0400
committerJim Hahn <jrh3@att.com>2020-08-25 14:28:02 -0400
commit59f4f54cdf4c1a5c155360239272da690e8c4a72 (patch)
tree47fc9d91bb83b62f429e1ae8b1587c314f710f41 /models-interactions/model-impl/sdnr/src/test/java
parent43aaa62cdf9a7dadfb6d688f1fe83c5bd355a86d (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/sdnr/src/test/java')
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java7
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java7
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java7
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java7
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java7
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java4
6 files changed, 12 insertions, 27 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 8c7ee6d53..f4c0bf32d 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
@@ -77,13 +77,10 @@ public class PciCommonHeaderTest {
copiedPciCommonHeader.setSubRequestId(commonHeader.getSubRequestId());
copiedPciCommonHeader.setTimeStamp(commonHeader.getTimeStamp());
- /*
- * Disabling sonar to test equals().
- */
- assertEquals(commonHeader, commonHeader); // NOSONAR
+ assertEquals(commonHeader, (Object) commonHeader);
assertEquals(commonHeader, copiedPciCommonHeader);
assertNotEquals(commonHeader, null);
- assertNotEquals(commonHeader, "Hello"); // NOSONAR
+ assertNotEquals(commonHeader, (Object) "Hello");
PciCommonHeader clonedPciCommonHeader = new PciCommonHeader(commonHeader);
clonedPciCommonHeader.setApiVer(commonHeader.getApiVer());
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 7719d0966..0bff14de9 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
@@ -59,13 +59,10 @@ public class PciRequestTest {
copiedPciRequest.setAction(request.getAction());
copiedPciRequest.setPayload(request.getPayload());
- /*
- * Disabling sonar to test equals().
- */
- assertEquals(request, request); // NOSONAR
+ assertEquals(request, (Object) request);
assertEquals(request, copiedPciRequest);
assertNotEquals(request, null);
- assertNotEquals(request, "Hello"); // NOSONAR
+ assertNotEquals(request, (Object) "Hello");
request.setCommonHeader(null);
assertNotEquals(request, copiedPciRequest);
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 65f362378..a5c81bc1a 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
@@ -49,13 +49,10 @@ public class PciRequestWrapperTest {
PciRequestWrapper copiedPciRequestWrapper = new PciRequestWrapper();
copiedPciRequestWrapper.setBody(requestWrapper.getBody());
- /*
- * Disabling sonar to test equals().
- */
- assertEquals(requestWrapper, requestWrapper); // NOSONAR
+ assertEquals(requestWrapper, (Object) requestWrapper);
assertEquals(requestWrapper, copiedPciRequestWrapper);
assertNotEquals(requestWrapper, null);
- assertNotEquals(requestWrapper, "Hello"); // NOSONAR
+ assertNotEquals(requestWrapper, (Object) "Hello");
requestWrapper.setBody(null);
assertNotEquals(requestWrapper, copiedPciRequestWrapper);
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 cb12083f3..eab065500 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
@@ -49,13 +49,10 @@ public class PciResponseWrapperTest {
PciResponseWrapper copiedPciResponseWrapper = new PciResponseWrapper();
copiedPciResponseWrapper.setBody(responseWrapper.getBody());
- /*
- * Disabling sonar to test equals().
- */
- assertEquals(responseWrapper, responseWrapper); // NOSONAR
+ assertEquals(responseWrapper, (Object) responseWrapper);
//assertEquals(responseWrapper, copiedPciResponseWrapper);
assertNotEquals(responseWrapper, null);
- assertNotEquals(responseWrapper, "Hello"); // NOSONAR
+ assertNotEquals(responseWrapper, (Object) "Hello");
responseWrapper.setBody(null);
assertNotEquals(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 2f6c7f8ba..d496f86fe 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
@@ -50,13 +50,10 @@ public class PciStatusTest {
copiedStatus.setCode(status.getCode());
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/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 d25be8340..914974691 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
@@ -68,10 +68,10 @@ public class PciWrapperTest {
copiedPciWrapper.setCorrelationId(wrapper.getCorrelationId());
copiedPciWrapper.setType(wrapper.getType());
- assertEquals(wrapper, wrapper);
+ assertEquals(wrapper, (Object) wrapper);
assertEquals(wrapper, copiedPciWrapper);
assertNotEquals(wrapper, null);
- assertNotEquals(wrapper, "Hello");
+ assertNotEquals(wrapper, (Object) "Hello");
wrapper.setVersion(null);
assertNotEquals(wrapper, copiedPciWrapper);