From: Jim Hahn Date: Fri, 28 Aug 2020 21:01:46 +0000 (-0400) Subject: Fix sonar issue in distributed locking X-Git-Tag: 1.7.1~5 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=22fda392c020fb6381afcc645554fd01636661ed;p=policy%2Fdrools-pdp.git Fix sonar issue in distributed locking Fixed sonar issue: - Refactor the code of the lambda to have only one invocation throwing an exception Issue-ID: POLICY-2616 Change-Id: I8d96b95d0da9a780daacec7a4de17167642b03c1 Signed-off-by: Jim Hahn --- diff --git a/feature-distributed-locking/src/test/java/org/onap/policy/distributed/locking/DistributedLockManagerTest.java b/feature-distributed-locking/src/test/java/org/onap/policy/distributed/locking/DistributedLockManagerTest.java index 48152715..0c0dbf11 100644 --- a/feature-distributed-locking/src/test/java/org/onap/policy/distributed/locking/DistributedLockManagerTest.java +++ b/feature-distributed-locking/src/test/java/org/onap/policy/distributed/locking/DistributedLockManagerTest.java @@ -258,7 +258,8 @@ public class DistributedLockManagerTest { } }; - assertThatThrownBy(() -> feature.beforeCreateLockManager(engine, new Properties())) + Properties props = new Properties(); + assertThatThrownBy(() -> feature.beforeCreateLockManager(engine, props)) .isInstanceOf(DistributedLockManagerException.class); }