aboutsummaryrefslogtreecommitdiffstats
path: root/context
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-07-13 12:55:42 +0000
committerGerrit Code Review <gerrit@onap.org>2020-07-13 12:55:42 +0000
commit2649f1da1ac58352d6d11c48923ee86930e3e8ee (patch)
treeb612c05875a07c690be1372e11c53281b4ea5871 /context
parentb09f7de07ee653397d1287314260f1df67b66bf6 (diff)
parentd879346e830b810eeccf8283fa16e04a9cfafbc8 (diff)
Merge "Fix assertTrue SONAR issues in apex-pdp/contex and apex-pdp/core"
Diffstat (limited to 'context')
-rw-r--r--context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
index ad165c3c5..51802919c 100644
--- a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
+++ b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +22,7 @@
package org.onap.policy.apex.context.impl;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -337,20 +338,20 @@ public class ContextAlbumImplTest {
distributor.init(axContextAlbum.getKey());
ContextAlbumImpl album = new ContextAlbumImpl(axContextAlbum, distributor, new LinkedHashMap<String, Object>());
- assertTrue(album.hashCode() != 0);
+ assertNotEquals(0, album.hashCode());
assertEquals(0, album.compareTo(album));
assertEquals(1, album.compareTo(null));
- assertTrue(album.equals(album));
- assertFalse(album.equals(new DummyContextAlbumImpl()));
+ assertEquals(album, album);
+ assertNotEquals(album, new DummyContextAlbumImpl());
ContextAlbumImpl otherAlbum = new ContextAlbumImpl(axContextAlbum, distributor,
new LinkedHashMap<String, Object>());
- assertTrue(album.equals(otherAlbum));
+ assertEquals(album, otherAlbum);
otherAlbum.put("Key", 123);
- assertFalse(album.equals(otherAlbum));
+ assertNotEquals(album, otherAlbum);
try {
otherAlbum.put("Key", "BadValue");
@@ -366,7 +367,7 @@ public class ContextAlbumImplTest {
otherAxContextAlbum.setItemSchema(simpleStringSchema.getKey());
otherAlbum = new ContextAlbumImpl(otherAxContextAlbum, distributor, new LinkedHashMap<String, Object>());
- assertFalse(album.equals(otherAlbum));
+ assertNotEquals(album, otherAlbum);
try {
album.flush();
@@ -379,7 +380,7 @@ public class ContextAlbumImplTest {
ModelService.registerModel(AxContextAlbums.class, albums);
albums.getAlbumsMap().put(axContextAlbum.getKey(), axContextAlbum);
distributor.createContextAlbum(album.getKey());
-
+
album.flush();
ModelService.clear();