diff options
author | waynedunican <wayne.dunican@est.tech> | 2020-08-07 09:51:52 +0100 |
---|---|---|
committer | waynedunican <wayne.dunican@est.tech> | 2020-08-10 11:34:03 +0100 |
commit | 09212e0d7326c2933ed437ee36188a241b8cf900 (patch) | |
tree | 03f33a3a95ab0aa086c38e22c1fd0ffdb715fa94 /core | |
parent | a926cdc113b5fad19a34dbf45e66bd7cbb5ed6e0 (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')
5 files changed, 13 insertions, 11 deletions
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java index 6ac0d2e33..fa04f19b5 100644 --- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java +++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java @@ -148,8 +148,8 @@ public class EnEventTest { assertNull(event.get("MyField")); assertNotEquals(0, event.hashCode()); - - assertEquals(event, event); + // disabling sonar because this code tests the equals() method + assertEquals(event, event); // NOSONAR assertNotNull(event); Map<String, Object> hashMap = new HashMap<>(); assertNotEquals(event, hashMap); 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())); |