open class MockMvcHtmlUnitDriverBuilder : MockMvcWebConnectionBuilderSupport<MockMvcHtmlUnitDriverBuilder>
MockMvcHtmlUnitDriverBuilder simplifies the building of an HtmlUnitDriver that delegates to MockMvc and optionally delegates to an actual connection for specific requests.
By default, the driver will delegate to MockMvc to handle requests to localhost and to a WebClient to handle any other URL (i.e. to perform an actual HTTP request).
Author
Rob Winch
Author
Sam Brannen
Since
4.2
See Also
#mockMvcSetup(MockMvc)#webAppContextSetup(WebApplicationContext)#webAppContextSetup(WebApplicationContext, MockMvcConfigurer)#javascriptEnabled(boolean)#withDelegate(WebConnectionHtmlUnitDriver)#build()
open fun build(): HtmlUnitDriver
Build the HtmlUnitDriver configured via this builder. The returned driver 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 fun javascriptEnabled(javascriptEnabled: Boolean): MockMvcHtmlUnitDriverBuilder
Specify whether JavaScript should be enabled. Default is |
|
open static fun mockMvcSetup(mockMvc: MockMvc): MockMvcHtmlUnitDriverBuilder
Create a new |
|
open static fun webAppContextSetup(context: WebApplicationContext): MockMvcHtmlUnitDriverBuilder
Create a new open static fun webAppContextSetup(context: WebApplicationContext, configurer: MockMvcConfigurer): MockMvcHtmlUnitDriverBuilder
Create a new |
|
open fun withDelegate(driver: WebConnectionHtmlUnitDriver): MockMvcHtmlUnitDriverBuilder
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 |