diff options
author | Taka Cho <takamune.cho@att.com> | 2020-07-02 11:56:18 -0400 |
---|---|---|
committer | Taka Cho <takamune.cho@att.com> | 2020-07-02 12:34:49 -0400 |
commit | 427cbbb9e25f843bcf06d75904f6294ac07180be (patch) | |
tree | 46f4abb3a5be369874567bab0016102c6c7bc678 /policy-core/src | |
parent | 11fe26a917bdd6aa54aa40cb21396df824410d83 (diff) |
drools-pdp sonar fix
most of changes are assert statement
Issue-ID: POLICY-2616
Change-Id: I3bd3076115d28d8cfabcbe0859cc4b21085e1394
Signed-off-by: Taka Cho <takamune.cho@att.com>
Diffstat (limited to 'policy-core/src')
-rw-r--r-- | policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java | 5 | ||||
-rw-r--r-- | policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java | 3 |
2 files changed, 5 insertions, 3 deletions
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 |