Interface WebTestClient.Bodyspec<B, s extends WebTestClient.Bodyspec<B,s>>
- Type Parameters:
B- the body types- a self reference to the spec type
- All Known subinterfaces:
WebTestClient.ListBodyspec<E>
- Enclosing interface:
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.
- since:
- 5.0
- Author:
- Rossen stoyanchev, Brian Clozel, sam Brannen, MichaĆ Rowicki
-
Method summary
Modifier and TypeMethodDescription<T extends s>
TconsumeWith(Consumer<EntityExchangeResult<B>> consumer) Assert the exchange result with the givenConsumer.<T extends s>
TAssert the extracted body is equal to the given value.Exit the chained API and return anExchangeResultwith the decoded response content.<T extends s, R>
Tvalue(@NonNull Function<@Nullable B, @Nullable R> bodyMapper, Consumer<? super R> consumer) Transform the extracted the body with a function, for example, extracting a property, and assert the mapped value with aConsumer.<T extends s, R>
TDeprecated, for removal: This API element is subject to removal in a future version.<T extends s>
TAssert the extracted body with aConsumer.<T extends s>
TDeprecated, for removal: This API element is subject to removal in a future version.in favor ofConsumer-based variants, and AssertJ support viaWebTestClientResponse
-
Method Details
-
isEqualTo
-
value
@Deprecated(since="7.0", forRemoval=true) @NullUnmarked <T extends s> T value(Matcher<? super B> matcher) Deprecated, for removal: This API element is subject to removal in a future version.in favor ofConsumer-based variants, and AssertJ support viaWebTestClientResponseAssert the extracted body with aMatcher.- since:
- 5.1
-
value
@Deprecated(since="7.0", forRemoval=true) @NullUnmarked <T extends s, R> T value(@NonNull Function<@Nullable B, @Nullable R> bodyMapper, Matcher<? super R> matcher) Deprecated, for removal: This API element is subject to removal in a future version.in favor ofConsumer-based variants, and AssertJ support viaWebTestClientResponseTransform the extracted the body with a function, for example, extracting a property, and assert the mapped value with aMatcher.- since:
- 5.1
-
value
-
value
-
consumeWith
Assert the exchange result with the givenConsumer. -
returnResult
EntityExchangeResult<B> returnResult()Exit the chained API and return anExchangeResultwith the decoded response content.
-
Consumer-based variants, and AssertJ support viaWebTestClientResponse