open class MockMvcWebClientBuilder : MockMvcWebConnectionBuilderSupport<MockMvcWebClientBuilder>
MockMvcWebClientBuilder
simplifies the creation of an HtmlUnit WebClient that delegates to a MockMvc instance.
The MockMvc
instance used by the builder may be supplied directly or created transparently from a WebApplicationContext
.
Author
Rob Winch
Author
Sam Brannen
Since
4.2
See Also
#mockMvcSetup(MockMvc)#webAppContextSetup(WebApplicationContext)#webAppContextSetup(WebApplicationContext, MockMvcConfigurer)#withDelegate(WebClient)#build()
open fun build(): WebClient
Build the WebClient configured via this builder. The returned client will use the configured MockMvc instance for processing any WebRequestMatcher requests and a delegate If a delegate has been explicitly configured, it will be used; otherwise, a default |
|
open static fun mockMvcSetup(mockMvc: MockMvc): MockMvcWebClientBuilder
Create a new |
|
open static fun webAppContextSetup(context: WebApplicationContext): MockMvcWebClientBuilder
Create a new open static fun webAppContextSetup(context: WebApplicationContext, configurer: MockMvcConfigurer): MockMvcWebClientBuilder
Create a new |
|
open fun withDelegate(webClient: WebClient): MockMvcWebClientBuilder
Supply the |
open fun alwaysUseMockMvc(): T
Specify that MockMvc should always be used regardless of what the request looks like. |
|
open fun contextPath(contextPath: String): T
Set the context path to use. If the supplied value is Default is |
|
open fun useMockMvc(vararg matchers: WebRequestMatcher): T
Add additional WebRequestMatcher instances that will ensure that MockMvc is used to process the request, if such a matcher matches against the web request. |
|
open fun useMockMvcForHosts(vararg hosts: String): T
Add additional WebRequestMatcher instances that return |