Package | Description |
---|---|
org.springframework.test.web.reactive.server |
Support for testing Spring WebFlux server endpoints via
WebTestClient . |
org.springframework.test.web.servlet.client |
Support for testing Spring MVC applications via
WebTestClient
with MockMvc for server request
handling. |
Modifier and Type | Method and Description |
---|---|
WebTestClient.Builder |
WebTestClient.Builder.apply(WebTestClientConfigurer configurer)
Apply the given configurer to this builder instance.
|
WebTestClient.Builder |
WebTestClient.Builder.baseUrl(String baseUrl)
Configure a base URI as described in
WebClient.create(String) . |
static WebTestClient.Builder |
WebTestClient.bindToServer()
This server setup option allows you to connect to a live server through
a Reactor Netty client connector.
|
static WebTestClient.Builder |
WebTestClient.bindToServer(org.springframework.http.client.reactive.ClientHttpConnector connector)
A variant of
WebTestClient.bindToServer() with a pre-configured connector. |
WebTestClient.Builder |
WebTestClient.Builder.codecs(Consumer<org.springframework.http.codec.ClientCodecConfigurer> configurer)
|
WebTestClient.Builder |
WebTestClient.MockServerSpec.configureClient()
Proceed to configure and build the test client.
|
WebTestClient.Builder |
WebTestClient.Builder.defaultCookie(String cookieName,
String... cookieValues)
Add the given header to all requests that haven't added it.
|
WebTestClient.Builder |
WebTestClient.Builder.defaultCookies(Consumer<org.springframework.util.MultiValueMap<String,String>> cookiesConsumer)
Manipulate the default cookies with the given consumer.
|
WebTestClient.Builder |
WebTestClient.Builder.defaultHeader(String headerName,
String... headerValues)
Add the given header to all requests that haven't added it.
|
WebTestClient.Builder |
WebTestClient.Builder.defaultHeaders(Consumer<org.springframework.http.HttpHeaders> headersConsumer)
Manipulate the default headers with the given consumer.
|
WebTestClient.Builder |
WebTestClient.Builder.exchangeStrategies(Consumer<org.springframework.web.reactive.function.client.ExchangeStrategies.Builder> configurer)
Deprecated.
as of 5.1.13 in favor of
codecs(Consumer) |
WebTestClient.Builder |
WebTestClient.Builder.exchangeStrategies(org.springframework.web.reactive.function.client.ExchangeStrategies strategies)
Configure the
ExchangeStrategies to use. |
WebTestClient.Builder |
WebTestClient.Builder.filter(org.springframework.web.reactive.function.client.ExchangeFilterFunction filter)
Add the given filter to the filter chain.
|
WebTestClient.Builder |
WebTestClient.Builder.filters(Consumer<List<org.springframework.web.reactive.function.client.ExchangeFilterFunction>> filtersConsumer)
Manipulate the filters with the given consumer.
|
WebTestClient.Builder |
WebTestClient.mutate()
Return a builder to mutate properties of this web test client.
|
WebTestClient.Builder |
WebTestClient.Builder.responseTimeout(Duration timeout)
Max amount of time to wait for responses.
|
WebTestClient.Builder |
WebTestClient.Builder.uriBuilderFactory(org.springframework.web.util.UriBuilderFactory uriBuilderFactory)
Provide a pre-configured
UriBuilderFactory instance as an
alternative to and effectively overriding baseUrl(String) . |
Modifier and Type | Method and Description |
---|---|
void |
WebTestClientConfigurer.afterConfigurerAdded(WebTestClient.Builder builder,
org.springframework.web.server.adapter.WebHttpHandlerBuilder httpHandlerBuilder,
org.springframework.http.client.reactive.ClientHttpConnector connector)
Invoked once only, immediately (i.e.
|
Modifier and Type | Method and Description |
---|---|
static WebTestClient.Builder |
MockMvcWebTestClient.bindTo(MockMvc mockMvc)
Begin creating a
WebTestClient by providing an already
initialized MockMvc instance to use as the server. |
WebTestClient.Builder |
MockMvcWebTestClient.MockMvcServerSpec.configureClient()
Proceed to configure and build the test client.
|