spring-framework / org.springframework.test.web.client.match / MockRestRequestMatchers / jsonPath

jsonPath

open static fun jsonPath(expression: String, vararg args: Any): JsonPathRequestMatchers

Access to request body matchers using a JsonPath expression to inspect a specific subset of the body. The JSON path expression can be a parameterized string using formatting specifiers as defined in String#format(String, Object...).

Parameters

expression - the JSON path optionally parameterized with arguments

args - arguments to parameterize the JSON path expression with

open static fun <T : Any> jsonPath(expression: String, matcher: Matcher<T>): RequestMatcher

Access to request body matchers using a JsonPath expression to inspect a specific subset of the body and a Hamcrest match for asserting the value found at the JSON path.

Parameters

expression - the JSON path expression

matcher - a matcher for the value expected at the JSON path