From 53b9324d6ec14ef75dc1f943c19b3ea1a46bc8ab Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Fri, 17 Jul 2020 14:08:52 +0100 Subject: Fix assertTrue in apex-pdp/model apex-pdp/plugins, apex-pdp/services and apex-pdp/testsuites Replace assertTrue with assertEquals and assertFalse with assertNotEquals in apex-pdp/model, apex-pdp/plugins, apex-pdp/services and apex-pdp/testsuites Issue-ID: POLICY-2690 Change-Id: If088371cf012d5648e04ade2aa4d49b38945f6d2 Signed-off-by: JvD_Ericsson --- .../onap/policy/apex/model/utilities/KeyComparerTest.java | 14 +++++++------- .../policy/apex/model/utilities/KeyedMapComparerTest.java | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'model/utilities/src/test') diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/KeyComparerTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/KeyComparerTest.java index 4cf91bd39..20780b271 100644 --- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/KeyComparerTest.java +++ b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/KeyComparerTest.java @@ -21,8 +21,8 @@ package org.onap.policy.apex.model.utilities; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; import org.junit.Test; import org.onap.policy.apex.model.utilities.comparison.KeyComparer; @@ -40,14 +40,14 @@ public class KeyComparerTest { KeyDifference keyDifference = new KeyComparer().compareKeys("Hello", "Goodbye"); assertFalse(keyDifference.isEqual()); - assertTrue("Hello".equals(keyDifference.getLeftKey().toString())); - assertTrue("Goodbye".equals(keyDifference.getRightKey().toString())); + assertEquals("Hello", keyDifference.getLeftKey().toString()); + assertEquals("Goodbye", keyDifference.getRightKey().toString()); - assertTrue("left key Hello and right key Goodbye differ\n".equals(keyDifference.asString(true))); - assertTrue("left key Hello and right key Goodbye differ\n".equals(keyDifference.asString(false))); + assertEquals("left key Hello and right key Goodbye differ\n", keyDifference.asString(true)); + assertEquals("left key Hello and right key Goodbye differ\n", keyDifference.asString(false)); KeyDifference keyDifference2 = new KeyComparer().compareKeys("Here", "Here"); - assertTrue("".equals(keyDifference2.asString(true))); - assertTrue("left key Here equals right key Here\n".equals(keyDifference2.asString(false))); + assertEquals("", keyDifference2.asString(true)); + assertEquals("left key Here equals right key Here\n", keyDifference2.asString(false)); } } diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/KeyedMapComparerTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/KeyedMapComparerTest.java index fb993b10f..b4e88e20d 100644 --- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/KeyedMapComparerTest.java +++ b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/KeyedMapComparerTest.java @@ -23,7 +23,6 @@ package org.onap.policy.apex.model.utilities; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; import java.util.TreeMap; import org.junit.Test; @@ -58,7 +57,7 @@ public class KeyedMapComparerTest { KeyedMapDifference kmComparedDiff = new KeyedMapComparer().compareMaps(leftMap, rightMap); - assertTrue(kmComparedSame.getIdenticalValues().equals(leftMap)); + assertEquals(leftMap, kmComparedSame.getIdenticalValues()); assertEquals(1, kmComparedDiff.getLeftOnly().size()); assertEquals(3, kmComparedDiff.getRightOnly().size()); assertEquals(2, kmComparedDiff.getDifferentValues().size()); -- cgit 1.2.3-korg