mirror of
https://github.com/fankes/moshi.git
synced 2025-10-18 23:49:21 +08:00
Merge pull request #11 from square/scottb/fail
Fix a few missing 'fail()' on expected exceptions
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
}
|
||||
|
@@ -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<A> is not allowed since D is not a static inner class.
|
||||
Types.newParameterizedTypeWithOwner(null, D.class, A.class);
|
||||
fail();
|
||||
} catch (IllegalArgumentException expected) {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user