public class JsonPathRequestMatchers
extends java.lang.Object
RequestMatcher
's using a JSONPath expression.
An instance of this class is typically accessed via
RequestMatchers.jsonPath(..)
.Modifier and Type | Class and Description |
---|---|
private static class |
JsonPathRequestMatchers.AbstractJsonPathRequestMatcher
Abstract base class for JSONPath
RequestMatcher 's. |
Modifier and Type | Field and Description |
---|---|
private JsonPathExpectationsHelper |
jsonPathHelper |
Modifier | Constructor and Description |
---|---|
protected |
JsonPathRequestMatchers(java.lang.String expression,
java.lang.Object... args)
Class constructor, not for direct instantiation.
|
Modifier and Type | Method and Description |
---|---|
RequestMatcher |
doesNotExist()
Evaluate the JSON path and assert the resulting content exists.
|
RequestMatcher |
exists()
Apply the JSONPath and assert the resulting value.
|
RequestMatcher |
isArray()
Assert the content at the given JSONPath is an array.
|
<T> RequestMatcher |
value(
Evaluate the JSONPath and assert the resulting value with the given
Matcher . |
RequestMatcher |
value(java.lang.Object expectedValue)
Apply the JSONPath and assert the resulting value.
|
private JsonPathExpectationsHelper jsonPathHelper
protected JsonPathRequestMatchers(java.lang.String expression, java.lang.Object... args)
MockRestRequestMatchers#jsonPath(String, Matcher)
or
MockRestRequestMatchers.jsonPath(String, Object...)
.expression
- the JSONPath expressionargs
- arguments to parameterize the JSONPath expression with using
the formatting specifiers defined in
String.format(String, Object...)
public <T> RequestMatcher value(matcher)
Matcher
.public RequestMatcher value(java.lang.Object expectedValue)
public RequestMatcher exists()
public RequestMatcher doesNotExist()
public RequestMatcher isArray()