com.jayway.jsonpath.matchers.JsonPathMatchers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-path-assert Show documentation
Show all versions of json-path-assert Show documentation
A library to query and verify JSON
package com.jayway.jsonpath.matchers;
import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.Predicate;
import com.jayway.jsonpath.ReadContext;
import org.hamcrest.Matcher;
import java.io.File;
import java.util.List;
import java.util.Map;
import static org.hamcrest.Matchers.*;
public class JsonPathMatchers {
private JsonPathMatchers() {
throw new AssertionError("prevent instantiation");
}
public static Matcher super Object> hasJsonPath(String jsonPath) {
return describedAs("has json path %0",
isJson(withJsonPath(jsonPath)),
jsonPath);
}
public static Matcher super Object> hasJsonPath(String jsonPath, Matcher resultMatcher) {
return isJson(withJsonPath(jsonPath, resultMatcher));
}
public static Matcher super Object> hasNoJsonPath(String jsonPath) {
return isJson(withoutJsonPath(jsonPath));
}
public static Matcher