From 59af0357bb79739066dd7eb17cdc3ce45d870944 Mon Sep 17 00:00:00 2001 From: Scott Blum Date: Tue, 12 Aug 2014 15:31:12 -0400 Subject: [PATCH] Fix a few missing 'fail()' on expected exceptions --- moshi/src/test/java/com/squareup/moshi/JsonReaderTest.java | 3 +++ moshi/src/test/java/com/squareup/moshi/TypesTest.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/moshi/src/test/java/com/squareup/moshi/JsonReaderTest.java b/moshi/src/test/java/com/squareup/moshi/JsonReaderTest.java index 3e5a5ba..000c679 100644 --- a/moshi/src/test/java/com/squareup/moshi/JsonReaderTest.java +++ b/moshi/src/test/java/com/squareup/moshi/JsonReaderTest.java @@ -189,10 +189,12 @@ public final class JsonReaderTest { @Test public void emptyString() { try { new JsonReader("").beginArray(); + fail(); } catch (IOException expected) { } try { new JsonReader("").beginObject(); + fail(); } catch (IOException expected) { } } @@ -200,6 +202,7 @@ public final class JsonReaderTest { @Test public void noTopLevelObject() { try { new JsonReader("true").nextBoolean(); + fail(); } catch (IOException expected) { } } diff --git a/moshi/src/test/java/com/squareup/moshi/TypesTest.java b/moshi/src/test/java/com/squareup/moshi/TypesTest.java index 83bd221..b4e4c85 100644 --- a/moshi/src/test/java/com/squareup/moshi/TypesTest.java +++ b/moshi/src/test/java/com/squareup/moshi/TypesTest.java @@ -25,6 +25,7 @@ import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; public class TypesTest { @Test public void newParameterizedTypeWithoutOwner() throws Exception { @@ -41,6 +42,7 @@ public class TypesTest { try { // D is not allowed since D is not a static inner class. Types.newParameterizedTypeWithOwner(null, D.class, A.class); + fail(); } catch (IllegalArgumentException expected) { }