Interface RestTestClient.Bodyspec<B, s extends RestTestClient.Bodyspec<B,s>>

Type Parameters:
B - the body type
s - a self reference to the spec type
Enclosing interface:
RestTestClient

public static interface RestTestClient.Bodyspec<B, s extends RestTestClient.Bodyspec<B,s>>
spec for expectations on the response body decoded to a single Object.
since:
7.0
Author:
Rob Worsnop, Rossen stoyanchev
  • Method Details

    • isEqualTo

      <T extends s>&nbsp;T&nbsp;isEqualTo(@Nullable B&nbsp;expected)
      Assert the extracted body is equal to the given value.
    • value

      <T extends s>&nbsp;T&nbsp;value(Consumer<@Nullable B>&nbsp;consumer)
      Assert the extracted body with a Consumer.
    • value

      <T extends s, R>&nbsp;T&nbsp;value(Function<@Nullable B, @Nullable R>&nbsp;bodyMapper, Consumer<? super @Nullable R>&nbsp;consumer)
      Transform the extracted the body with a function, for example, extracting a property, and assert the mapped value with a Consumer.
    • consumeWith

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

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