Merge pull request #11 from square/scottb/fail
Fix a few missing 'fail()' on expected exceptions
This commit is contained in:
commit
c11ad0c2e6
2 changed files with 5 additions and 0 deletions
|
@ -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) {
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue