Fix more sonars in xacml-pdp 76/109676/1
authorJim Hahn <jrh3@att.com>
Tue, 30 Jun 2020 11:23:40 +0000 (07:23 -0400)
committerJim Hahn <jrh3@att.com>
Tue, 30 Jun 2020 11:26:37 +0000 (07:26 -0400)
Somehow missed this sonar issue in one line of code:
- invoke only one method in a junit lambda

Issue-ID: POLICY-2681
Change-Id: I03a6708e0d3ed2a43577a63d0f3cdfc9bd76c8d8
Signed-off-by: Jim Hahn <jrh3@att.com>
applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java

index d3aba91..9ff8142 100644 (file)
@@ -211,9 +211,10 @@ public class XacmlPolicyUtilsTest {
         assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->
             XacmlPolicyUtils.writePolicyFile(fileTemp, "not a policy")
         );
+
+        Path rootPath = policyFolder.getRoot().toPath();
         assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->
-            XacmlPolicyUtils.constructUniquePolicyFilename("not a policy",
-                    policyFolder.getRoot().toPath())
+            XacmlPolicyUtils.constructUniquePolicyFilename("not a policy", rootPath)
         );
     }