summaryrefslogtreecommitdiffstats
path: root/model/context-model/src/test
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/context-model/src/test
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/context-model/src/test')
-rw-r--r--model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java9
-rw-r--r--model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java5
-rw-r--r--model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java8
3 files changed, 11 insertions, 11 deletions
diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java
index 74b000ff3..2e2005fcd 100644
--- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java
+++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java
@@ -115,11 +115,11 @@ public class ContextAlbumsTest {
+ "AxArtifactKey:(name=AlbumSchemaName,version=0.0.1))", clonedAlbum.toString());
assertNotEquals(0, album.hashCode());
-
- assertEquals(album, album);
+ // disabling sonar because this code tests the equals() method
+ assertEquals(album, album); // NOSONAR
assertEquals(album, clonedAlbum);
assertNotNull(album);
- assertNotEquals(album, (Object) "Hello");
+ assertNotEquals(album, "Hello");
assertNotEquals(album, new AxContextAlbum(new AxArtifactKey(), "Scope", false, AxArtifactKey.getNullKey()));
assertNotEquals(album, new AxContextAlbum(newKey, "Scope", false, AxArtifactKey.getNullKey()));
assertNotEquals(album, new AxContextAlbum(newKey, "NewAlbumScope", false, AxArtifactKey.getNullKey()));
@@ -183,10 +183,9 @@ public class ContextAlbumsTest {
assertNotEquals(0, albums.hashCode());
- assertEquals(albums, albums);
assertEquals(albums, clonedAlbums);
assertNotNull(albums);
- assertNotEquals(albums, (Object) "Hello");
+ assertNotEquals(albums, "Hello");
assertNotEquals(albums, new AxContextAlbums(new AxArtifactKey()));
assertEquals(0, albums.compareTo(albums));
diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java
index 1be226cbd..ae6de38f2 100644
--- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java
+++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java
@@ -60,9 +60,10 @@ public class ContextModelTest {
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 AxContextModel(new AxArtifactKey()));
assertNotEquals(model, new AxContextModel(new AxArtifactKey(), new AxContextSchemas(), new AxContextAlbums(),
new AxKeyInformation()));
diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java
index abe7c008f..55844d9d9 100644
--- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java
+++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java
@@ -103,10 +103,11 @@ public class ContextSchemasTest {
assertNotEquals(0, schema.hashCode());
- assertEquals(schema, schema);
+ // disabling sonar because this code tests the equals() method
+ assertEquals(schema, schema); // NOSONAR
assertEquals(schema, clonedSchema);
assertNotNull(schema);
- assertNotEquals(schema, (Object) "Hello");
+ assertNotEquals(schema, "Hello");
assertNotEquals(schema, new AxContextSchema(new AxArtifactKey(), "Flavour", "Def"));
assertNotEquals(schema, new AxContextSchema(newKey, "Flavour", "Def"));
assertNotEquals(schema, new AxContextSchema(newKey, "NewSchemaFlavour", "Def"));
@@ -165,10 +166,9 @@ public class ContextSchemasTest {
assertNotEquals(0, schemas.hashCode());
- assertEquals(schemas, schemas);
assertEquals(schemas, clonedSchemas);
assertNotNull(schemas);
- assertNotEquals(schemas, (Object) "Hello");
+ assertNotEquals(schemas, "Hello");
assertNotEquals(schemas, new AxContextSchemas(new AxArtifactKey()));
assertEquals(0, schemas.compareTo(schemas));