接口 WebTestClient.BodySpec<B,S extends WebTestClient.BodySpec<B,S>>
- 类型参数:
S
- a self reference to the spec typeB
- the body type
- 所有已知子接口:
WebTestClient.ListBodySpec<E>
- 封闭接口:
- WebTestClient
public static interface WebTestClient.BodySpec<B,S extends WebTestClient.BodySpec<B,S>>
Spec for expectations on the response body decoded to a single Object.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 <T extends S>
TconsumeWith(Consumer<EntityExchangeResult<B>> consumer)
Assert the exchange result with the givenConsumer
.<T extends S>
TisEqualTo(B expected)
Assert the extracted body is equal to the given value.EntityExchangeResult<B>
returnResult()
Exit the chained API and return anExchangeResult
with the decoded response content.<T extends S>
Tvalue(Consumer<B> consumer)
Assert the extracted body with aConsumer
.<T extends S,R>
Tvalue(Function<B,R> bodyMapper, Matcher<R> matcher)
Transform the extracted the body with a function, e.g. extracting a property, and assert the mapped value with aMatcher
.<T extends S>
Tvalue(Matcher<B> matcher)
Assert the extracted body with aMatcher
.
方法详细资料
isEqualTo
<T extends S> T isEqualTo(B expected)
Assert the extracted body is equal to the given value.
value
<T extends S,R> T value(Function<B,R> bodyMapper, Matcher<R> matcher)
Transform the extracted the body with a function, e.g. extracting a property, and assert the mapped value with aMatcher
.- 从以下版本开始:
- 5.1
value
<T extends S> T value(Consumer<B> consumer)
Assert the extracted body with aConsumer
.- 从以下版本开始:
- 5.1
consumeWith
<T extends S> T consumeWith(Consumer<EntityExchangeResult<B>> consumer)
Assert the exchange result with the givenConsumer
.
returnResult
EntityExchangeResult<B> returnResult()
Exit the chained API and return anExchangeResult
with the decoded response content.