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 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.org.springframework.http.HttpMethodReturn the method of the request.org.springframework.http.HttpHeadersReturn the request headers sent to the server.org.springframework.util.MultiValueMap<String, org.springframework.http.ResponseCookie> Return response cookies received from the server.org.springframework.http.HttpHeadersReturn the response headers received from the server.org.springframework.http.HttpStatusCodeReturn 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
-
getMethod
public org.springframework.http.HttpMethod getMethod()Return the method of the request. -
getUrl
Return the URI of the request. -
getUriTemplate
-
getRequestHeaders
public org.springframework.http.HttpHeaders getRequestHeaders()Return the request headers sent to the server. -
getStatus
public org.springframework.http.HttpStatusCode getStatus()Return the HTTP status code as anHttpStatusCodevalue. -
getResponseHeaders
public org.springframework.http.HttpHeaders getResponseHeaders()Return the response headers received from the server. -
getResponseCookies
public org.springframework.util.MultiValueMap<String, org.springframework.http.ResponseCookie> getResponseCookies()Return response cookies received from the server. -
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
-