diff options
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())); |