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 | Constructor and Description |
|---|---|
protected |
ExchangeResult(ExchangeResult other)
Copy constructor used when the body is decoded or consumed.
|
protected |
ExchangeResult(org.springframework.test.web.reactive.server.WiretapClientHttpRequest request,
org.springframework.test.web.reactive.server.WiretapClientHttpResponse response)
Constructor used when the
ClientHttpResponse becomes available. |
| 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. |
org.springframework.http.HttpMethod |
getMethod()
Return the method of the request.
|
byte[] |
getRequestBodyContent()
Return the raw request body content written as a
byte[]. |
org.springframework.http.HttpHeaders |
getRequestHeaders()
Return the request headers sent to the server.
|
byte[] |
getResponseBodyContent()
Return the raw request body content written as a
byte[]. |
org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> |
getResponseCookies()
Return response cookies received from the server.
|
org.springframework.http.HttpHeaders |
getResponseHeaders()
Return the response headers received from the server.
|
org.springframework.http.HttpStatus |
getStatus()
Return the status of the executed request.
|
URI |
getUrl()
Return the request headers that were sent to the server.
|
String |
toString() |
protected ExchangeResult(org.springframework.test.web.reactive.server.WiretapClientHttpRequest request,
org.springframework.test.web.reactive.server.WiretapClientHttpResponse response)
ClientHttpResponse becomes available.protected ExchangeResult(ExchangeResult other)
public org.springframework.http.HttpMethod getMethod()
public URI getUrl()
public org.springframework.http.HttpHeaders getRequestHeaders()
public byte[] getRequestBodyContent()
byte[].IllegalStateException - if the request body is not fully written yet.public org.springframework.http.HttpStatus getStatus()
public org.springframework.http.HttpHeaders getResponseHeaders()
public org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> getResponseCookies()
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.