aboutsummaryrefslogtreecommitdiffstats
path: root/context/context-management
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2020-07-07 13:18:20 +0100
committerJvD_Ericsson <jeff.van.dam@est.tech>2020-07-10 13:32:26 +0100
commitd879346e830b810eeccf8283fa16e04a9cfafbc8 (patch)
treedc297a302dcaf59695b2096523721e48f9ecd2dd /context/context-management
parentfb826f241cb78b70910f842bbed0bb507b1236ca (diff)
Fix assertTrue SONAR issues in apex-pdp/contex and apex-pdp/core
Replace assertTrue with assertEquals and assertFalse with assertNotEquals in apex-pdp/client apex-pdp/context and apex-pdp/core Issue-ID: POLICY-2690 Change-Id: Ic1e69c75e5f8f887cac135b6728b007faf4b19a6 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Diffstat (limited to 'context/context-management')
-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();