Class ExchangeResult
java.lang.Object
org.springframework.test.web.servlet.client.ExchangeResult
- Direct Known Subclasses:
EntityExchangeResult
Container for request and response details for exchanges performed through
RestTestClient
.- Since:
- 7.0
- Author:
- Rob Worsnop, Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assertWithDiagnostics
(Runnable assertion) Execute the given Runnable, catch anyAssertionError
, log details about the request and response at ERROR level under the class log category, and after that re-throw the error.Return the method of the request.byte[]
Return the raw request body content written through the request.Return the request headers sent to the server.byte[]
Return the raw response body read through the response.Return response cookies received from the server.Return the response headers received from the server.Return the HTTP status code as anHttpStatusCode
value.Return the original URI template used to prepare the request, if any.getUrl()
Return the URI of the request.toString()
-
Method Details
-
getMethod
Return the method of the request. -
getUrl
Return the URI of the request. -
getUriTemplate
-
getRequestHeaders
Return the request headers sent to the server. -
getStatus
Return the HTTP status code as anHttpStatusCode
value. -
getResponseHeaders
Return the response headers received from the server. -
getResponseCookies
Return response cookies received from the server. -
getRequestBodyContent
public byte[] getRequestBodyContent()Return the raw request body content written through the request. -
getResponseBodyContent
public byte[] getResponseBodyContent()Return the raw response body read through the response. -
assertWithDiagnostics
Execute the given Runnable, catch anyAssertionError
, log details about the request and response at ERROR level under the class log category, and after that re-throw the error. -
toString
-