From 09212e0d7326c2933ed437ee36188a241b8cf900 Mon Sep 17 00:00:00 2001 From: waynedunican Date: Fri, 7 Aug 2020 09:51:52 +0100 Subject: 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 --- .../onap/policy/apex/model/enginemodel/concepts/EngineModelTest.java | 5 +++-- .../onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'model/engine-model') diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineModelTest.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineModelTest.java index f3f2fb602..9d1c7bf44 100644 --- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineModelTest.java +++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineModelTest.java @@ -98,9 +98,10 @@ public class EngineModelTest { assertNotEquals(0, model.hashCode()); - assertEquals(model, model); + // disabling sonar because this code tests the equals() method + assertEquals(model, model); // NOSONAR assertEquals(model, clonedModel); - assertNotEquals(model, (Object) "Hello"); + assertNotEquals(model, "Hello"); assertNotEquals(model, new AxEngineModel(new AxArtifactKey())); assertNotEquals(model, new AxEngineModel(new AxArtifactKey(), new AxContextSchemas(schemasKey), new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats)); diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java index 5cb1bd40e..7669f67bd 100644 --- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java +++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java @@ -134,7 +134,8 @@ public class EngineStatsTest { assertNotEquals(0, stats.hashCode()); - assertEquals(stats, stats); + // disabling sonar because this code tests the equals() method + assertEquals(stats, stats); // NOSONAR assertEquals(stats, clonedStats); assertNotNull(stats); -- cgit 1.2.3-korg