From 8b32784d749d4bcacfa4e8f684501559f999be07 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 15 Feb 2019 09:50:25 -0500 Subject: Fix sonar issues with gson code Fixed issues with GsonTestUtils: - don't set static from within a non-static method - don't throw generic RuntimeException Resolved checkstyle issue. Removed trailing spaces. Change-Id: If0c85733f62a24b56088dc90aadd4b95b3a6c91a Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn --- .../java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java') diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java index 39cde7dc..58beb2a6 100644 --- a/utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java +++ b/utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java @@ -135,8 +135,10 @@ public class GsonTestUtilsTest { result = utils.applyScripts("use ${obj.text} this", data); assertEquals("use null this", result); - assertThatThrownBy(() -> utils.applyScripts("use ${obj.text} this", null)).isInstanceOf(RuntimeException.class) - .hasCauseInstanceOf(ScriptException.class).hasMessage("cannot expand element: ${obj.text}"); + assertThatThrownBy(() -> utils.applyScripts("use ${obj.text} this", null)) + .isInstanceOf(JsonParseException.class) + .hasCauseInstanceOf(ScriptException.class) + .hasMessage("cannot expand element: ${obj.text}"); } @Test -- cgit 1.2.3-korg