接口 WebTestClient.BodySpec<B,S extends WebTestClient.BodySpec<B,S>>

类型参数:
S - a self reference to the spec type
B - the body type
所有已知子接口:
WebTestClient.ListBodySpec<E>
所有已知实现类:
DefaultWebTestClient.DefaultBodySpec, DefaultWebTestClient.DefaultListBodySpec
封闭接口:
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>
    T
    Assert the exchange result with the given Consumer.
    <T extends S>
    T
    isEqualTo(B expected)
    Assert the extracted body is equal to the given value.
    Exit the chained API and return an ExchangeResult with the decoded response content.
    <T extends S>
    T
    value(Consumer<B> consumer)
    Assert the extracted body with a Consumer.
    <T extends S, R>
    T
    value(Function<B,R> bodyMapper, org.hamcrest.Matcher<? super R> matcher)
    Transform the extracted the body with a function, e.g. extracting a property, and assert the mapped value with a Matcher.
    <T extends S>
    T
    value(org.hamcrest.Matcher<? super B> matcher)
    Assert the extracted body with a Matcher.
  • 方法详细资料

    • isEqualTo

      <T extends S> T isEqualTo(B expected)
      Assert the extracted body is equal to the given value.
    • value

      <T extends S> T value(org.hamcrest.Matcher<? super B> matcher)
      Assert the extracted body with a Matcher.
    • value

      <T extends S, R> T value(Function<B,R> bodyMapper, org.hamcrest.Matcher<? super R> matcher)
      Transform the extracted the body with a function, e.g. extracting a property, and assert the mapped value with a Matcher.
    • value

      <T extends S> T value(Consumer<B> consumer)
      Assert the extracted body with a Consumer.
    • consumeWith

      <T extends S> T consumeWith(Consumer<EntityExchangeResult<B>> consumer)
      Assert the exchange result with the given Consumer.
    • returnResult

      EntityExchangeResult<B> returnResult()
      Exit the chained API and return an ExchangeResult with the decoded response content.