summaryrefslogtreecommitdiffstats
path: root/model/context-model
diff options
context:
space:
mode:
Diffstat (limited to 'model/context-model')
-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));