diff --git a/gson/src/test/java/com/google/gson/JsonStreamParserTest.java b/gson/src/test/java/com/google/gson/JsonStreamParserTest.java index 30b669c1fd..807b93f89d 100644 --- a/gson/src/test/java/com/google/gson/JsonStreamParserTest.java +++ b/gson/src/test/java/com/google/gson/JsonStreamParserTest.java @@ -84,7 +84,7 @@ public void testEmptyInput() { parser = new JsonStreamParser(""); e = assertThrows(JsonIOException.class, parser::hasNext); - assertThat(e.getCause()).isInstanceOf(EOFException.class); + assertThat(e).hasCauseThat().isInstanceOf(EOFException.class); } @Test