From 22fda392c020fb6381afcc645554fd01636661ed Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 28 Aug 2020 17:01:46 -0400 Subject: 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 --- .../onap/policy/distributed/locking/DistributedLockManagerTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'feature-distributed-locking') 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); } -- cgit 1.2.3-korg