7373 * Client for testing web servers that uses {@link WebClient} internally to
7474 * perform requests while also providing a fluent API to verify responses.
7575 * This client can connect to any server over HTTP, or to a WebFlux application
76- * via mock request and response objects .
76+ * with a mock request and response.
7777 *
7878 * <p>Use one of the bindToXxx methods to create an instance. For example:
7979 * <ul>
8989 * @author Sam Brannen
9090 * @author Michał Rowicki
9191 * @since 5.0
92- * @see StatusAssertions
93- * @see HeaderAssertions
94- * @see JsonPathAssertions
9592 */
9693public interface WebTestClient {
9794
@@ -172,12 +169,10 @@ public interface WebTestClient {
172169
173170
174171 /**
175- * Use this server setup to test one {@code @Controller} at a time.
176- * This option loads the default configuration of
177- * {@link org.springframework.web.reactive.config.EnableWebFlux @EnableWebFlux}.
178- * There are builder methods to customize the Java config. The resulting
179- * WebFlux application will be tested without an HTTP server using a mock
180- * request and response.
172+ * Begin creating a {@link WebTestClient} with a mock server setup that
173+ * tests one {@code @Controller} at a time with
174+ * {@link org.springframework.web.reactive.config.EnableWebFlux @EnableWebFlux}
175+ * equivalent configuration.
181176 * @param controllers one or more controller instances to test
182177 * (specified {@code Class} will be turned into instance)
183178 * @return chained API to customize server and client config; use
@@ -188,10 +183,10 @@ static ControllerSpec bindToController(Object... controllers) {
188183 }
189184
190185 /**
191- * Use this option to set up a server from a {@link RouterFunction}.
192- * Internally the provided configuration is passed to
193- * {@code RouterFunctions#toWebHandler}. The resulting WebFlux application
194- * will be tested without an HTTP server using a mock request and response .
186+ * Begin creating a {@link WebTestClient} with a mock server setup that
187+ * tests one {@code RouterFunction} at a time with
188+ * {@link org.springframework.web.reactive.config.EnableWebFlux @EnableWebFlux}
189+ * equivalent configuration .
195190 * @param routerFunction the RouterFunction to test
196191 * @return chained API to customize server and client config; use
197192 * {@link MockServerSpec#configureClient()} to transition to client config
@@ -229,8 +224,7 @@ static MockServerSpec<?> bindToWebHandler(WebHandler webHandler) {
229224 }
230225
231226 /**
232- * This server setup option allows you to connect to a live server through
233- * a Reactor Netty client connector.
227+ * This server setup option allows you to connect to a live server.
234228 * <p><pre class="code">
235229 * WebTestClient client = WebTestClient.bindToServer()
236230 * .baseUrl("http://localhost:8080")
@@ -389,17 +383,12 @@ interface RouterFunctionSpec extends MockServerSpec<RouterFunctionSpec> {
389383
390384
391385 /**
392- * Steps for customizing the {@link WebClient} used to test with,
393- * internally delegating to a
394- * {@link org.springframework.web.reactive.function.client.WebClient.Builder
395- * WebClient.Builder}.
386+ * Steps to customize the underlying {@link WebClient} via {@link WebClient.Builder}.
396387 */
397388 interface Builder {
398389
399390 /**
400- * Configure a base URI as described in
401- * {@link org.springframework.web.reactive.function.client.WebClient#create(String)
402- * WebClient.create(String)}.
391+ * Configure a base URI as described in {@link WebClient#create(String)}.
403392 */
404393 Builder baseUrl (String baseUrl );
405394
@@ -428,7 +417,7 @@ interface Builder {
428417 Builder defaultHeaders (Consumer <HttpHeaders > headersConsumer );
429418
430419 /**
431- * Add the given header to all requests that haven't added it.
420+ * Add the given cookie to all requests that haven't already added it.
432421 * @param cookieName the cookie name
433422 * @param cookieValues the cookie values
434423 */
@@ -718,6 +707,7 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
718707 * Specification for providing body of a request.
719708 */
720709 interface RequestBodySpec extends RequestHeadersSpec <RequestBodySpec > {
710+
721711 /**
722712 * Set the length of the body in bytes, as specified by the
723713 * {@code Content-Length} header.
@@ -738,7 +728,7 @@ interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> {
738728
739729 /**
740730 * Set the body to the given {@code Object} value. This method invokes the
741- * {@link org.springframework.web.reactive.function.client. WebClient.RequestBodySpec#bodyValue(Object)
731+ * {@link WebClient.RequestBodySpec#bodyValue(Object)
742732 * bodyValue} method on the underlying {@code WebClient}.
743733 * @param body the value to write to the request body
744734 * @return spec for further declaration of the request
@@ -773,7 +763,7 @@ <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
773763
774764 /**
775765 * Set the body from the given producer. This method invokes the
776- * {@link org.springframework.web.reactive.function.client. WebClient.RequestBodySpec#body(Object, Class)
766+ * {@link WebClient.RequestBodySpec#body(Object, Class)
777767 * body(Object, Class)} method on the underlying {@code WebClient}.
778768 * @param producer the producer to write to the request. This must be a
779769 * {@link Publisher} or another producer adaptable to a
@@ -786,7 +776,7 @@ <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
786776
787777 /**
788778 * Set the body from the given producer. This method invokes the
789- * {@link org.springframework.web.reactive.function.client. WebClient.RequestBodySpec#body(Object, ParameterizedTypeReference)
779+ * {@link WebClient.RequestBodySpec#body(Object, ParameterizedTypeReference)
790780 * body(Object, ParameterizedTypeReference)} method on the underlying {@code WebClient}.
791781 * @param producer the producer to write to the request. This must be a
792782 * {@link Publisher} or another producer adaptable to a
@@ -800,7 +790,7 @@ <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
800790 /**
801791 * Set the body of the request to the given {@code BodyInserter}.
802792 * This method invokes the
803- * {@link org.springframework.web.reactive.function.client. WebClient.RequestBodySpec#body(BodyInserter)
793+ * {@link WebClient.RequestBodySpec#body(BodyInserter)
804794 * body(BodyInserter)} method on the underlying {@code WebClient}.
805795 * @param inserter the body inserter to use
806796 * @return spec for further declaration of the request
@@ -908,8 +898,8 @@ interface ResponseSpec {
908898 BodyContentSpec expectBody ();
909899
910900 /**
911- * Exit the chained flow in order to consume the response body
912- * externally, for example, via {@link reactor.test.StepVerifier}.
901+ * Exit the chained flow in order to consume the response body externally,
902+ * for example, via {@link reactor.test.StepVerifier}.
913903 * <p>Note that when {@code Void.class} is passed in, the response body
914904 * is consumed and released. If no content is expected, then consider
915905 * using {@code .expectBody().isEmpty()} instead which asserts that
0 commit comments