com.fasterxml.jackson.core.JsonParseException

Here are the examples of the java api class com.fasterxml.jackson.core.JsonParseException taken from open source projects.

1. FunctionScoreQueryBuilderTests#testMalformedThrowsException()

Project: elasticsearch
File: FunctionScoreQueryBuilderTests.java
public void testMalformedThrowsException() throws IOException {
    String json = "{\n" + "    \"function_score\":{\n" + "        \"query\":{\n" + "            \"term\":{\n" + "                \"name.last\":\"banon\"\n" + "            }\n" + "        },\n" + "        \"functions\": [\n" + "            {\n" + "                {\n" + "            }\n" + "        ]\n" + "    }\n" + "}";
    JsonParseException e = expectThrows(JsonParseException.class, () -> parseQuery(json));
    assertThat(e.getMessage(), containsString("Unexpected character ('{"));
}