From 2fe32306ec44899a5c8102c46d54e53552b9b003 Mon Sep 17 00:00:00 2001 From: Taka Cho Date: Thu, 18 Jun 2020 13:23:17 -0400 Subject: pap - sonar issue fix replace by assertNotSame Issue-ID: POLICY-2616 Change-Id: I927dbd8c57654cd2d2ef6262d13d63c79ba9035f Signed-off-by: Taka Cho --- .../org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java | 7 ++++--- .../onap/policy/pap/main/notification/PolicyCommonTrackerTest.java | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'main') diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java index 414c1dbb..d57f667f 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java @@ -27,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; @@ -219,7 +220,7 @@ public class RequestImplTest extends CommonRequestBase { req.startPublishing(); QueueToken token2 = queue.poll(); assertNotNull(token2); - assertTrue(token2 != token); + assertNotSame(token, token2); assertSame(msg, token2.get()); } @@ -247,7 +248,7 @@ public class RequestImplTest extends CommonRequestBase { // a new token should have been placed in the queue QueueToken token2 = queue.poll(); - assertTrue(token != token2); + assertNotSame(token, token2); assertNull(queue.poll()); assertNotNull(token2); assertSame(msg3, token2.get()); @@ -259,7 +260,7 @@ public class RequestImplTest extends CommonRequestBase { // a new token should have been placed in the queue QueueToken token3 = queue.poll(); - assertTrue(token2 != token3); + assertNotSame(token2, token3); assertNull(queue.poll()); assertNotNull(token3); assertSame(msg4, token3.get()); diff --git a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java index fc43c7a9..34d4db60 100644 --- a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java @@ -23,6 +23,7 @@ package org.onap.policy.pap.main.notification; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; @@ -126,7 +127,7 @@ public class PolicyCommonTrackerTest extends PolicyCommonSupport { assertFalse(data.isComplete()); // policy 2 should have its own data - assertTrue(map.get(policy2) != data); + assertNotSame(data, map.get(policy2)); data = map.get(policy2); assertNotNull(data); assertFalse(data.isComplete()); -- cgit 1.2.3-korg