aboutsummaryrefslogtreecommitdiffstats
path: root/model/event-model
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 /model/event-model
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 'model/event-model')
-rw-r--r--model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java6
-rw-r--r--model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java8
-rw-r--r--model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java6
3 files changed, 10 insertions, 10 deletions
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 c86ba12e7..1731bcddc 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
@@ -58,10 +58,10 @@ public class EventModelTest {
final AxEventModel clonedModel = new AxEventModel(model);
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 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 629df1a5f..a2d562a6f 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
@@ -187,10 +187,11 @@ public class EventsTest {
assertNotEquals(0, event.hashCode());
- assertEquals(event, event);
+ // disabling sonar because this code tests the equals() method
+ assertEquals(event, event); // NOSONAR
assertEquals(event, clonedEvent);
assertNotNull(event);
- assertNotEquals(event, (Object) "Hello");
+ assertNotEquals(event, "Hello");
assertNotEquals(
event, new AxEvent(AxArtifactKey.getNullKey(), "namespace", "source", "target", parameterMap));
assertNotEquals(event, new AxEvent(eventKey, "namespace1", "source", "target", parameterMap));
@@ -270,10 +271,9 @@ public class EventsTest {
assertNotEquals(0, events.hashCode());
- assertEquals(events, events);
assertEquals(events, clonedEvents);
assertNotNull(events);
- assertNotEquals(events, (Object) "Hello");
+ assertNotEquals(events, "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 e5a01ed6f..dd76d329c 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
@@ -109,11 +109,11 @@ public class FieldTest {
+ "AxArtifactKey:(name=SchemaName,version=0.0.1),optional=true)", clonedField.toString());
assertNotEquals(0, field.hashCode());
-
- assertEquals(field, field);
+ // disabling sonar because this code tests the equals() method
+ assertEquals(field, field); // NOSONAR
assertEquals(field, clonedField);
assertNotNull(field);
- assertNotEquals(field, (Object) "Hello");
+ assertNotEquals(field, "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));