public static interface WebTestClient.ResponseSpec
Modifier and Type | Method and Description |
---|---|
WebTestClient.BodyContentSpec |
expectBody()
Consume and decode the response body to
byte[] and then apply
assertions on the raw content (e.g. |
<B> WebTestClient.BodySpec<B,?> |
expectBody(Class<B> bodyType)
Consume and decode the response body to a single object of type
<B> and then apply assertions. |
<B> WebTestClient.BodySpec<B,?> |
expectBody(ParameterizedTypeReference<B> bodyType)
Alternative to
expectBody(Class) that accepts information
about a target type with generics. |
<E> WebTestClient.ListBodySpec<E> |
expectBodyList(Class<E> elementType)
Consume and decode the response body to
List<E> and then apply
List-specific assertions. |
<E> WebTestClient.ListBodySpec<E> |
expectBodyList(ParameterizedTypeReference<E> elementType)
Alternative to
expectBodyList(Class) that accepts information
about a target type with generics. |
CookieAssertions |
expectCookie()
Assertions on the cookies of the response.
|
HeaderAssertions |
expectHeader()
Assertions on the headers of the response.
|
StatusAssertions |
expectStatus()
Assertions on the response status.
|
<T> FluxExchangeResult<T> |
returnResult(Class<T> elementClass)
Exit the chained flow in order to consume the response body
externally, e.g.
|
<T> FluxExchangeResult<T> |
returnResult(ParameterizedTypeReference<T> elementTypeRef)
Alternative to
returnResult(Class) that accepts information
about a target type with generics. |
StatusAssertions expectStatus()
HeaderAssertions expectHeader()
CookieAssertions expectCookie()
<B> WebTestClient.BodySpec<B,?> expectBody(Class<B> bodyType)
<B>
and then apply assertions.bodyType
- the expected body type<B> WebTestClient.BodySpec<B,?> expectBody(ParameterizedTypeReference<B> bodyType)
expectBody(Class)
that accepts information
about a target type with generics.<E> WebTestClient.ListBodySpec<E> expectBodyList(Class<E> elementType)
List<E>
and then apply
List-specific assertions.elementType
- the expected List element type<E> WebTestClient.ListBodySpec<E> expectBodyList(ParameterizedTypeReference<E> elementType)
expectBodyList(Class)
that accepts information
about a target type with generics.WebTestClient.BodyContentSpec expectBody()
byte[]
and then apply
assertions on the raw content (e.g. isEmpty, JSONPath, etc.)<T> FluxExchangeResult<T> returnResult(Class<T> elementClass)
StepVerifier
.
Note that when Void.class
is passed in, the response body
is consumed and released. If no content is expected, then consider
using .expectBody().isEmpty()
instead which asserts that
there is no content.
<T> FluxExchangeResult<T> returnResult(ParameterizedTypeReference<T> elementTypeRef)
returnResult(Class)
that accepts information
about a target type with generics.