summaryrefslogtreecommitdiffstats
path: root/utils/src/test/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-29 10:16:44 -0400
committerJim Hahn <jrh3@att.com>2020-06-29 11:09:58 -0400
commitff0842117fba4dfe675a8b87af3a1098cde023bd (patch)
tree1dde66fc3323e9bb3edec8bf83df1456cbf6fffd /utils/src/test/java
parent4cdfdf4fa218a3b4f7e9690355db85976bc1888d (diff)
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 <jrh3@att.com>
Diffstat (limited to 'utils/src/test/java')
-rw-r--r--utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java5
1 files changed, 4 insertions, 1 deletions
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