summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/events
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-07-21 09:55:38 -0400
committerJim Hahn <jrh3@att.com>2020-07-21 16:25:53 -0400
commit248a660d61fa03caa4710cf8cfe144eb245b807b (patch)
tree9f7c9aa7fda6d9ab9977bf2398a0136a787dc62a /models-interactions/model-impl/events
parentf203526d0f86d385976da394bd1f0f918e4445d9 (diff)
Fix some sonars in policy-models
Fixed the following sonar issues in some of the project directories: - use assertNull, assertEquals, etc. - swap assertEquals arguments - extract a constant - don't invoke toString() in logger calls - TODOs - generic types Issue-ID: POLICY-2714 Change-Id: Id8803f9bf617ea9fc173a67b8606600709b55bdc Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/events')
-rw-r--r--models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java
index eb1a351d1..54eec71b5 100644
--- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java
+++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* controlloop
* ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,11 +35,14 @@ public class ControlLoopOperationTest {
public void test() {
ControlLoopOperation operation = new ControlLoopOperation();
- assertEquals(operation, operation);
- assertNotEquals(operation, new String());
+ /*
+ * Disabling sonar to test equals().
+ */
+ assertEquals(operation, operation); // NOSONAR
+ assertNotEquals(operation, ""); // NOSONAR
assertNotEquals(operation, null);
- assertTrue(operation.hashCode() != 0);
+ assertNotEquals(0, operation.hashCode());
assertTrue(operation.toString().startsWith("ControlLoopOperation"));
assertNotNull(operation);
@@ -68,7 +71,7 @@ public class ControlLoopOperationTest {
operation.setTarget("target");
assertEquals("target", operation.getTarget());
- assertTrue(operation.hashCode() != 0);
+ assertNotEquals(0, operation.hashCode());
ControlLoopOperation operation2 = new ControlLoopOperation(operation);
assertEquals(now, operation2.getEnd());