22= RestTestClient
33
44`RestTestClient` is an HTTP client designed for testing server applications. It wraps
5- Spring's xref:integration/rest-clients.adoc#rest-restclient[`RestClient`] and uses it to perform requests
5+ Spring's xref:integration/rest-clients.adoc#rest-restclient[`RestClient`] and uses it to perform requests,
66but exposes a testing facade for verifying responses. `RestTestClient` can be used to
77perform end-to-end HTTP tests. It can also be used to test Spring MVC
8- applications without a running server via mock server request and response objects .
8+ applications without a running server via MockMvc .
99
1010
1111
@@ -14,7 +14,7 @@ applications without a running server via mock server request and response objec
1414== Setup
1515
1616To set up a `RestTestClient` you need to choose a server setup to bind to. This can be one
17- of several mock server setup choices or a connection to a live server.
17+ of several MockMvc setup choices, or a connection to a live server.
1818
1919
2020
@@ -144,9 +144,7 @@ Kotlin::
144144
145145In addition to the server setup options described earlier, you can also configure client
146146options, including base URL, default headers, client filters, and others. These options
147- are readily available following `bindToServer()`. For all other configuration options,
148- you need to use `configureClient()` to transition from server to client configuration, as
149- follows:
147+ are readily available following the initial `bindTo` call, as follows:
150148
151149[tabs]
152150======
@@ -155,7 +153,6 @@ Java::
155153[source,java,indent=0,subs="verbatim,quotes"]
156154----
157155 client = RestTestClient.bindToController(new TestController())
158- .configureClient()
159156 .baseUrl("/test")
160157 .build();
161158----
@@ -165,7 +162,6 @@ Kotlin::
165162[source,kotlin,indent=0,subs="verbatim,quotes"]
166163----
167164 client = RestTestClient.bindToController(TestController())
168- .configureClient()
169165 .baseUrl("/test")
170166 .build()
171167----
@@ -180,7 +176,7 @@ Kotlin::
180176`RestTestClient` provides an API identical to xref:integration/rest-clients.adoc#rest-restclient[`RestClient`]
181177up to the point of performing a request by using `exchange()`.
182178
183- After the call to `exchange()`, `RestTestClient` diverges from the `RestClient` and
179+ After the call to `exchange()`, `RestTestClient` diverges from `RestClient`, and
184180instead continues with a workflow to verify responses.
185181
186182To assert the response status and headers, use the following:
@@ -310,8 +306,7 @@ Kotlin::
310306======
311307
312308TIP: When you need to decode to a target type with generics, look for the overloaded methods
313- that accept
314- {spring-framework-api}/core/ParameterizedTypeReference.html[`ParameterizedTypeReference`]
309+ that accept{spring-framework-api}/core/ParameterizedTypeReference.html[`ParameterizedTypeReference`]
315310instead of `Class<T>`.
316311
317312
@@ -346,8 +341,7 @@ Kotlin::
346341----
347342======
348343
349- If you want to ignore the response content, the following releases the content without
350- any assertions:
344+ If you want to ignore the response content, the following releases the content without any assertions:
351345
352346[tabs]
353347======
0 commit comments