From 427cbbb9e25f843bcf06d75904f6294ac07180be Mon Sep 17 00:00:00 2001 From: Taka Cho Date: Thu, 2 Jul 2020 11:56:18 -0400 Subject: drools-pdp sonar fix most of changes are assert statement Issue-ID: POLICY-2616 Change-Id: I3bd3076115d28d8cfabcbe0859cc4b21085e1394 Signed-off-by: Taka Cho --- .../test/java/org/onap/policy/drools/core/DroolsContainerTest.java | 5 +++-- .../src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'policy-core') diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java b/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java index 928af4de..939de08c 100644 --- a/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java +++ b/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java @@ -22,6 +22,7 @@ package org.onap.policy.drools.core; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; @@ -117,7 +118,7 @@ public class DroolsContainerTest { try { // fetch the session, and verify that it exists PolicySession session = container.getPolicySession("session1"); - assertTrue(session != null); + assertNotNull(session); // get all sessions, and verify that this one is the only one { @@ -279,7 +280,7 @@ public class DroolsContainerTest { try { // fetch the session, and verify that it exists PolicySession session = container.getPolicySession("session1"); - assertTrue(session != null); + assertNotNull(session); // get all sessions, and verify that this one is the only one { diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java b/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java index 0422b486..7b565f76 100644 --- a/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java +++ b/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java @@ -22,6 +22,7 @@ package org.onap.policy.drools.core.jmx; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import org.junit.Before; @@ -40,7 +41,7 @@ public class PdpJmxTest { public void testGetInstance() { jmx = PdpJmx.getInstance(); assertNotNull(jmx); - assertTrue(PdpJmx.getInstance() == jmx); + assertSame(jmx, PdpJmx.getInstance()); } @Test -- cgit 1.2.3-korg