open class JsonPathResultMatchers
Factory for assertions on the response content using JsonPath expressions.
An instance of this class is typically accessed via MockMvcResultMatchers#jsonPath(String, Matcher) or MockMvcResultMatchers#jsonPath(String, Object...).
Author
Rossen Stoyanchev
Author
Craig Andrews
Author
Sam Brannen
Author
Brian Clozel
Since
3.2
open fun doesNotExist(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that a value does not exist at the given path. If the JSON path expression is not definite, this method asserts that the value at the given path is empty. |
|
open fun exists(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that a non-null value exists at the given path. If the JSON path expression is not definite, this method asserts that the value at the given path is not empty. |
|
open fun isArray(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that the result is an array. |
|
open fun isBoolean(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that the result is a Boolean. |
|
open fun isEmpty(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that an empty value exists at the given path. For the semantics of empty, consult the Javadoc for |
|
open fun isMap(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that the result is a java.util.Map. |
|
open fun isNotEmpty(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that a non-empty value exists at the given path. For the semantics of empty, consult the Javadoc for |
|
open fun isNumber(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that the result is a Number. |
|
open fun isString(): ResultMatcher
Evaluate the JSON path expression against the response content and assert that the result is a String. |
|
open fun prefix(prefix: String): JsonPathResultMatchers
Configures the current Use this method if the JSON payloads are prefixed to avoid Cross Site Script Inclusion (XSSI) attacks. |
|
open fun <T : Any> value(matcher: Matcher<T>): ResultMatcher
Evaluate the JSON path expression against the response content and assert the resulting value with the given Hamcrest Matcher. open fun value(expectedValue: Any): ResultMatcher
Evaluate the JSON path expression against the response content and assert that the result is equal to the supplied value. |