public static interface WebTestClient.Builder
WebClient used to test with
internally delegating to a WebClient.Builder.| Modifier and Type | Method and Description |
|---|---|
WebTestClient.Builder |
baseUrl(String baseUrl)
Configure a base URI as described in
WebClient.create(String). |
WebTestClient |
build()
Build the
WebTestClient instance. |
WebTestClient.Builder |
defaultCookie(String cookieName,
String... cookieValues)
Add the given header to all requests that haven't added it.
|
WebTestClient.Builder |
defaultHeader(String headerName,
String... headerValues)
Add the given header to all requests that haven't added it.
|
WebTestClient.Builder |
exchangeStrategies(org.springframework.web.reactive.function.client.ExchangeStrategies strategies)
Configure the
ExchangeStrategies to use. |
WebTestClient.Builder |
responseTimeout(Duration timeout)
Max amount of time to wait for responses.
|
WebTestClient.Builder |
uriBuilderFactory(org.springframework.web.util.UriBuilderFactory uriBuilderFactory)
Provide a pre-configured
UriBuilderFactory instance as an
alternative to and effectively overriding baseUrl(String). |
WebTestClient.Builder baseUrl(String baseUrl)
WebClient.create(String).WebTestClient.Builder uriBuilderFactory(org.springframework.web.util.UriBuilderFactory uriBuilderFactory)
UriBuilderFactory instance as an
alternative to and effectively overriding baseUrl(String).WebTestClient.Builder defaultHeader(String headerName, String... headerValues)
headerName - the header nameheaderValues - the header valuesWebTestClient.Builder defaultCookie(String cookieName, String... cookieValues)
cookieName - the cookie namecookieValues - the cookie valuesWebTestClient.Builder exchangeStrategies(org.springframework.web.reactive.function.client.ExchangeStrategies strategies)
ExchangeStrategies to use.
By default ExchangeStrategies.withDefaults() is used.
strategies - the strategies to useWebTestClient.Builder responseTimeout(Duration timeout)
By default 5 seconds.
timeout - the response timeout valueWebTestClient build()
WebTestClient instance.