Fix sonar issue in distributed locking 54/111854/1
authorJim Hahn <jrh3@att.com>
Fri, 28 Aug 2020 21:01:46 +0000 (17:01 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 28 Aug 2020 21:04:29 +0000 (17:04 -0400)
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 <jrh3@att.com>
feature-distributed-locking/src/test/java/org/onap/policy/distributed/locking/DistributedLockManagerTest.java

index 4815271..0c0dbf1 100644 (file)
@@ -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);
     }