aboutsummaryrefslogtreecommitdiffstats
path: root/core/core-protocols
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2020-08-07 09:51:52 +0100
committerwaynedunican <wayne.dunican@est.tech>2020-08-10 11:34:03 +0100
commit09212e0d7326c2933ed437ee36188a241b8cf900 (patch)
tree03f33a3a95ab0aa086c38e22c1fd0ffdb715fa94 /core/core-protocols
parenta926cdc113b5fad19a34dbf45e66bd7cbb5ed6e0 (diff)
SONAR assertion cleanup
Replaced assertions to not have the same actual and expected expression in apex-pdp Issue-ID: POLICY-2761 Change-Id: I2bf45a3cc4411bd39f93f9d0b8c8e56dd318281e Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'core/core-protocols')
-rw-r--r--core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java3
-rw-r--r--core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/EngineServiceInfoResponseTest.java6
-rw-r--r--core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/ResponseTest.java6
-rw-r--r--core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/UpdateModelTest.java5
4 files changed, 11 insertions, 9 deletions
diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java
index 925884534..db13069f1 100644
--- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java
+++ b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java
@@ -64,7 +64,8 @@ public class SupportMessageTester {
dummyMessage = new DummyMessage(null, null, null);
assertEquals(0, dummyMessage.hashCode());
- assertEquals(dummyMessage, dummyMessage);
+ // disabling sonar because this code tests the equals() method
+ assertEquals(dummyMessage, dummyMessage); // NOSONAR
assertNotNull(dummyMessage);
assertNotEquals(dummyMessage, new StartEngine(new AxArtifactKey()));
diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/EngineServiceInfoResponseTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/EngineServiceInfoResponseTest.java
index 87fe44aae..6e588dbe3 100644
--- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/EngineServiceInfoResponseTest.java
+++ b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/EngineServiceInfoResponseTest.java
@@ -71,10 +71,10 @@ public class EngineServiceInfoResponseTest {
response.setEngineKeyArray(engineKeyArrayList);
assertNotEquals(0, response.hashCode());
response.setEngineKeyArray(null);
-
- assertEquals(response, response);
+ // disabling sonar because this code tests the equals() method
+ assertEquals(response, response); // NOSONAR
assertNotNull(response);
- assertNotEquals(response, (Object) new StartEngine(new AxArtifactKey()));
+ assertNotEquals(response, new StartEngine(new AxArtifactKey()));
response = new EngineServiceInfoResponse(null, false, null);
EngineServiceInfoResponse otherResponse = new EngineServiceInfoResponse(null, false, null);
diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/ResponseTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/ResponseTest.java
index b28993a41..35fe5bb9f 100644
--- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/ResponseTest.java
+++ b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/ResponseTest.java
@@ -53,7 +53,7 @@ public class ResponseTest {
final AxArtifactKey responseKey = new AxArtifactKey("ResponseTest", "0.0.1");
final AxArtifactKey responseToKey = new AxArtifactKey("ResponseTestTo", "0.0.1");
UpdateModel responseTo = new UpdateModel(responseToKey);
-
+
Response message = new Response(responseKey, false, responseTo);
logger.debug(message.toString());
assertTrue(message.toString().contains("ResponseTest"));
@@ -73,8 +73,8 @@ public class ResponseTest {
assertNotEquals(0, message.hashCode());
message = new Response(responseKey, true, new UpdateModel(null));
assertNotEquals(0, message.hashCode());
-
- assertEquals(message, message);
+ // disabling sonar because this code tests the equals() method
+ assertEquals(message, message); // NOSONAR
assertNotNull(message);
assertNotEquals(message, new StartEngine(new AxArtifactKey()));
diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/UpdateModelTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/UpdateModelTest.java
index 0839a43b8..13d37a8f6 100644
--- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/UpdateModelTest.java
+++ b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/UpdateModelTest.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,8 +69,8 @@ public class UpdateModelTest {
assertNotEquals(0, message.hashCode());
message = new UpdateModel(null, null, false, true);
assertNotEquals(0, message.hashCode());
-
- assertEquals(message, message);
+ // disabling sonar because this code tests the equals() method
+ assertEquals(message, message); // NOSONAR
assertNotNull(message);
assertNotEquals(message, new StartEngine(new AxArtifactKey()));