From d37c71292d9cbdd892f328d63f49a8027b1f13c4 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 13 Jun 2019 10:39:55 -0400 Subject: Fix simple sonar issues in models Added @FunctionalInterface where needed. Replaced anonymous classes with lambda expressions. Replaced duplicate strings with a constant. Removed unused BeforeClass & AfterClass test methods. Removed some trailing spaces. Fixed: aai actor.appc actor.appclcm actor.sdnc actor.sdnr actor.so actor.vfc actorServiceProvider appc appclcm cds events Change-Id: I0e21cbb10db6d1217bbd0e00e6dd4fac3eb84e31 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn --- .../onap/policy/controlloop/ControlLoopNotificationTest.java | 2 +- .../policy/controlloop/params/ControlLoopParamsTest.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'models-interactions/model-impl/events') diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java index 0c1070e44..2ad097254 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java @@ -61,7 +61,7 @@ public class ControlLoopNotificationTest { assertEquals("from", notification.getFrom()); notification.setHistory(Collections.emptyList()); - assertTrue(notification.getHistory().size() == 0); + assertTrue(notification.getHistory().isEmpty()); notification.setMessage("message"); assertEquals("message", notification.getMessage()); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/params/ControlLoopParamsTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/params/ControlLoopParamsTest.java index bf23e5706..fd17f782e 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/params/ControlLoopParamsTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/params/ControlLoopParamsTest.java @@ -21,8 +21,8 @@ package org.onap.policy.controlloop.params; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -41,11 +41,11 @@ public class ControlLoopParamsTest { ControlLoopParams params2 = new ControlLoopParams(params); - assertTrue(params2.getClosedLoopControlName().equals("name")); - assertTrue(params2.getControlLoopYaml().equals("yaml")); - assertTrue(params2.getPolicyName().equals("name")); - assertTrue(params2.getPolicyScope().equals("scope")); - assertTrue(params2.getPolicyVersion().equals("1")); + assertEquals("name", params2.getClosedLoopControlName()); + assertEquals("yaml", params2.getControlLoopYaml()); + assertEquals("name", params2.getPolicyName()); + assertEquals("scope", params2.getPolicyScope()); + assertEquals("1", params2.getPolicyVersion()); } } -- cgit 1.2.3-korg