From d879346e830b810eeccf8283fa16e04a9cfafbc8 Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Tue, 7 Jul 2020 13:18:20 +0100 Subject: 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 --- .../policy/apex/core/engine/event/EnEventTest.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'core/core-engine') diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java index e3d0b32b8..225e1853f 100644 --- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java +++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java @@ -1,19 +1,20 @@ /*- * ============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. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -21,7 +22,8 @@ package org.onap.policy.apex.core.engine.event; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -195,14 +197,14 @@ public class EnEventTest { event.clear(); assertNull(event.get("MyField")); - assertTrue(event.hashCode() != 0); + assertNotEquals(0, event.hashCode()); - assertTrue(event.equals(event)); - assertFalse(event.equals(null)); + assertEquals(event, event); + assertNotNull(event); Map hashMap = new HashMap<>(); - assertFalse(event.equals(hashMap)); + assertNotEquals(event, hashMap); EnEvent otherEvent = new EnEvent(eventKey); - assertTrue(event.equals(otherEvent)); + assertEquals(event, otherEvent); } } -- cgit 1.2.3-korg