From ff0842117fba4dfe675a8b87af3a1098cde023bd Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 29 Jun 2020 10:16:44 -0400 Subject: Fix issues in common for new sonar rules Addressed issues reported due to updates to the sonar rules: - invoke only one method in a junit lambda - complete the assertion - add DOCTYPE to html Issue-ID: POLICY-2650 Change-Id: Ib8b8a2e4736cc23849c0f7aef972ffa3365a3e00 Signed-off-by: Jim Hahn --- .../java/org/onap/policy/common/utils/coder/StandardCoderTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'utils/src/test') diff --git a/utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java b/utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java index ad4382ce..a468f0b4 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java @@ -31,6 +31,7 @@ import static org.mockito.Mockito.when; import com.google.gson.JsonElement; import com.google.gson.JsonParseException; +import com.google.gson.JsonSyntaxException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -319,7 +320,9 @@ public class StandardCoderTest { assertEquals(json, coder.toJson(sco)); // invalid json -> exception - assertThatThrownBy(() -> coder.fromJson(new StringReader("["), StandardCoderObject.class)); + StringReader rdr = new StringReader("["); + assertThatThrownBy(() -> coder.fromJson(rdr, StandardCoderObject.class)) + .isInstanceOf(JsonSyntaxException.class); } @Test -- cgit 1.2.3-korg