spring-framework / org.springframework.test.web.reactive.server / ExchangeResult

ExchangeResult

open class ExchangeResult

Container for request and response details for exchanges performed through WebTestClient.

Note that a decoded response body is not exposed at this level since the body may not have been decoded and consumed yet. Sub-types EntityExchangeResult and FluxExchangeResult provide access to a decoded response entity and a decoded (but not consumed) response body respectively.

Author
Rossen Stoyanchev

Since
5.0

See Also
EntityExchangeResultFluxExchangeResult

Functions

assertWithDiagnostics

open fun assertWithDiagnostics(assertion: Runnable): Unit

Execute the given Runnable, catch any AssertionError, decorate with AssertionError containing diagnostic information about the request and response, and then re-throw.

getMethod

open fun getMethod(): HttpMethod

Return the method of the request.

getRequestBodyContent

open fun getRequestBodyContent(): ByteArray

Return the raw request body content written as a byte[].

getRequestHeaders

open fun getRequestHeaders(): HttpHeaders

Return the request headers sent to the server.

getResponseBodyContent

open fun getResponseBodyContent(): ByteArray

Return the raw request body content written as a byte[].

getResponseCookies

open fun getResponseCookies(): MultiValueMap<String, ResponseCookie>

Return response cookies received from the server.

getResponseHeaders

open fun getResponseHeaders(): HttpHeaders

Return the response headers received from the server.

getStatus

open fun getStatus(): HttpStatus

Return the status of the executed request.

getUriTemplate

open fun getUriTemplate(): String

Return the original URI template used to prepare the request, if any.

getUrl

open fun getUrl(): URI

Return the URI of the request.

toString

open fun toString(): String