aboutsummaryrefslogtreecommitdiffstats
path: root/core/core-engine
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2020-07-07 13:18:20 +0100
committerJvD_Ericsson <jeff.van.dam@est.tech>2020-07-10 13:32:26 +0100
commitd879346e830b810eeccf8283fa16e04a9cfafbc8 (patch)
treedc297a302dcaf59695b2096523721e48f9ecd2dd /core/core-engine
parentfb826f241cb78b70910f842bbed0bb507b1236ca (diff)
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 <jeff.van.dam@est.tech>
Diffstat (limited to 'core/core-engine')
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java20
1 files changed, 11 insertions, 9 deletions
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<String, Object> hashMap = new HashMap<>();
- assertFalse(event.equals(hashMap));
+ assertNotEquals(event, hashMap);
EnEvent otherEvent = new EnEvent(eventKey);
- assertTrue(event.equals(otherEvent));
+ assertEquals(event, otherEvent);
}
}