public class ExchangeResult extends Object
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.
EntityExchangeResult
,
FluxExchangeResult
Modifier and Type | Method and Description |
---|---|
void |
assertWithDiagnostics(Runnable assertion)
Execute the given Runnable, catch any
AssertionError , decorate
with AssertionError containing diagnostic information about the
request and response, and then re-throw. |
HttpMethod |
getMethod()
Return the method of the request.
|
byte[] |
getRequestBodyContent()
Return the raw request body content written as a
byte[] . |
HttpHeaders |
getRequestHeaders()
Return the request headers sent to the server.
|
byte[] |
getResponseBodyContent()
Return the raw request body content written as a
byte[] . |
MultiValueMap<String,ResponseCookie> |
getResponseCookies()
Return response cookies received from the server.
|
HttpHeaders |
getResponseHeaders()
Return the response headers received from the server.
|
HttpStatus |
getStatus()
Return the status of the executed request.
|
String |
getUriTemplate()
Return the original URI template used to prepare the request, if any.
|
URI |
getUrl()
Return the URI of the request.
|
String |
toString() |
public HttpMethod getMethod()
public URI getUrl()
@Nullable public String getUriTemplate()
public HttpHeaders getRequestHeaders()
@Nullable public byte[] getRequestBodyContent()
byte[]
.IllegalStateException
- if the request body is not fully written yet.public HttpStatus getStatus()
public HttpHeaders getResponseHeaders()
public MultiValueMap<String,ResponseCookie> getResponseCookies()
@Nullable public byte[] getResponseBodyContent()
byte[]
.IllegalStateException
- if the response is not fully read yet.public void assertWithDiagnostics(Runnable assertion)
AssertionError
, decorate
with AssertionError
containing diagnostic information about the
request and response, and then re-throw.