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 SummaryModifier and TypeMethodDescriptionvoidassertWithDiagnostics(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 anHttpStatusCodevalue.Return the original URI template used to prepare the request, if any.getUrl()Return the URI of the request.toString()
- 
Method Details- 
getMethodReturn the method of the request.
- 
getUrlReturn the URI of the request.
- 
getUriTemplate
- 
getRequestHeadersReturn the request headers sent to the server.
- 
getStatusReturn the HTTP status code as anHttpStatusCodevalue.
- 
getResponseHeadersReturn the response headers received from the server.
- 
getResponseCookiesReturn response cookies received from the server.
- 
getRequestBodyContentpublic byte[] getRequestBodyContent()Return the raw request body content written through the request.
- 
getResponseBodyContentpublic byte[] getResponseBodyContent()Return the raw response body read through the response.
- 
assertWithDiagnosticsExecute 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
 
-