Fix a few missing 'fail()' on expected exceptions

This commit is contained in:
Scott Blum
2014-08-12 15:31:12 -04:00
parent 9eb174c52e
commit 59af0357bb
2 changed files with 5 additions and 0 deletions

View File

@@ -189,10 +189,12 @@ public final class JsonReaderTest {
@Test public void emptyString() { @Test public void emptyString() {
try { try {
new JsonReader("").beginArray(); new JsonReader("").beginArray();
fail();
} catch (IOException expected) { } catch (IOException expected) {
} }
try { try {
new JsonReader("").beginObject(); new JsonReader("").beginObject();
fail();
} catch (IOException expected) { } catch (IOException expected) {
} }
} }
@@ -200,6 +202,7 @@ public final class JsonReaderTest {
@Test public void noTopLevelObject() { @Test public void noTopLevelObject() {
try { try {
new JsonReader("true").nextBoolean(); new JsonReader("true").nextBoolean();
fail();
} catch (IOException expected) { } catch (IOException expected) {
} }
} }

View File

@@ -25,6 +25,7 @@ import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
public class TypesTest { public class TypesTest {
@Test public void newParameterizedTypeWithoutOwner() throws Exception { @Test public void newParameterizedTypeWithoutOwner() throws Exception {
@@ -41,6 +42,7 @@ public class TypesTest {
try { try {
// D<A> is not allowed since D is not a static inner class. // D<A> is not allowed since D is not a static inner class.
Types.newParameterizedTypeWithOwner(null, D.class, A.class); Types.newParameterizedTypeWithOwner(null, D.class, A.class);
fail();
} catch (IllegalArgumentException expected) { } catch (IllegalArgumentException expected) {
} }