Search in sources :

Example 6 with JsonPathAssert

use of com.revinate.assertj.json.JsonPathAssert in project graylog2-server by Graylog2.

the class BooleanNumberConditionsVisitorTest method assertJsonPath.

private void assertJsonPath(Expression<Boolean> expression, Consumer<JsonPathAssert> consumer) throws Exception {
    final DocumentContext context = JsonPath.parse(objectMapper.writeValueAsString(expression));
    final JsonPathAssert jsonPathAssert = JsonPathAssert.assertThat(context);
    consumer.accept(jsonPathAssert);
}
Also used : JsonPathAssert(com.revinate.assertj.json.JsonPathAssert) DocumentContext(com.jayway.jsonpath.DocumentContext)

Aggregations

DocumentContext (com.jayway.jsonpath.DocumentContext)6 JsonPathAssert (com.revinate.assertj.json.JsonPathAssert)6 PaginatedList (org.graylog2.database.PaginatedList)4 Test (org.junit.Test)4