com.google.api.client.testing.json.MockJsonParser

Here are the examples of the java api class com.google.api.client.testing.json.MockJsonParser taken from open source projects.

1. JsonParserTest#testParseAndClose_noInputVoid()

Project: google-http-java-client
File: JsonParserTest.java
public void testParseAndClose_noInputVoid() throws Exception {
    MockJsonParser parser = (MockJsonParser) new MockJsonFactory().createJsonParser("");
    parser.parseAndClose(Void.class);
    assertTrue(parser.isClosed());
}

2. JsonParserTest#testParseAndClose_noInput()

Project: google-http-java-client
File: JsonParserTest.java
public void testParseAndClose_noInput() throws Exception {
    MockJsonParser parser = (MockJsonParser) new MockJsonFactory().createJsonParser("");
    try {
        parser.parseAndClose(Object.class);
    } catch (IllegalArgumentException e) {
        assertEquals("no JSON input found", e.getMessage());
        assertTrue(parser.isClosed());
    }
}