From a73217b479a500fb9420dbcb453a134ec8d1eee7 Mon Sep 17 00:00:00 2001 From: waynedunican Date: Fri, 14 Aug 2020 11:24:14 +0100 Subject: SONAR fixes - assert dissimiliar types Fix for assertions comparing dissimiliar types. Issue-ID: POLICY-2761 Change-Id: I1b2b8afa3e6308cda887d73a4ee079709847d054 Signed-off-by: waynedunican --- .../onap/policy/apex/model/eventmodel/concepts/EventModelTest.java | 2 +- .../org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java | 4 ++-- .../org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'model/event-model') diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java index 1731bcddc..cdc5fecf6 100644 --- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java +++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java @@ -61,7 +61,7 @@ public class EventModelTest { // disabling sonar because this code tests the equals() method assertEquals(model, model); // NOSONAR assertEquals(model, clonedModel); - assertNotEquals(model, "Hello"); + assertNotEquals(model, (Object) "Hello"); assertNotEquals(model, new AxEventModel(new AxArtifactKey())); assertNotEquals(model, new AxEventModel(modelKey, new AxContextSchemas(), new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey))); diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java index a2d562a6f..21601d770 100644 --- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java +++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java @@ -191,7 +191,7 @@ public class EventsTest { assertEquals(event, event); // NOSONAR assertEquals(event, clonedEvent); assertNotNull(event); - assertNotEquals(event, "Hello"); + assertNotEquals(event, (Object) "Hello"); assertNotEquals( event, new AxEvent(AxArtifactKey.getNullKey(), "namespace", "source", "target", parameterMap)); assertNotEquals(event, new AxEvent(eventKey, "namespace1", "source", "target", parameterMap)); @@ -273,7 +273,7 @@ public class EventsTest { assertEquals(events, clonedEvents); assertNotNull(events); - assertNotEquals(events, "Hello"); + assertNotEquals(events, (Object) "Hello"); assertNotEquals(events, new AxEvents(new AxArtifactKey())); assertEquals(0, events.compareTo(events)); diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java index dd76d329c..6ec46dbd5 100644 --- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java +++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java @@ -113,7 +113,7 @@ public class FieldTest { assertEquals(field, field); // NOSONAR assertEquals(field, clonedField); assertNotNull(field); - assertNotEquals(field, "Hello"); + assertNotEquals(field, (Object) "Hello"); assertNotEquals(field, new AxField(AxReferenceKey.getNullKey(), AxArtifactKey.getNullKey(), false)); assertNotEquals(field, new AxField(fieldKey, AxArtifactKey.getNullKey(), false)); assertNotEquals(field, new AxField(fieldKey, schemaKey, false)); -- cgit 1.2.3-korg