Class MockMvcWebClientBuilder
java.lang.Object
org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport<MockMvcWebClientBuilder>
org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
public class MockMvcWebClientBuilder
extends 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.
- Since:
- 4.2
- Author:
- Rob Winch, Sam Brannen
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedMockMvcWebClientBuilder(MockMvc mockMvc) protectedprotectedMockMvcWebClientBuilder(WebApplicationContext context, MockMvcConfigurer configurer) 
- 
Method SummaryModifier and TypeMethodDescriptioncom.gargoylesoftware.htmlunit.WebClientbuild()Build theWebClientconfigured via this builder.static MockMvcWebClientBuildermockMvcSetup(MockMvc mockMvc) Create a newMockMvcWebClientBuilderbased on the suppliedMockMvcinstance.static MockMvcWebClientBuilderwebAppContextSetup(WebApplicationContext context) Create a newMockMvcWebClientBuilderbased on the suppliedWebApplicationContext.static MockMvcWebClientBuilderwebAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer) Create a newMockMvcWebClientBuilderbased on the suppliedWebApplicationContextandMockMvcConfigurer.withDelegate(com.gargoylesoftware.htmlunit.WebClient webClient) Methods inherited from class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupportalwaysUseMockMvc, contextPath, createConnection, useMockMvc, useMockMvcForHosts
- 
Constructor Details- 
MockMvcWebClientBuilder
- 
MockMvcWebClientBuilder
- 
MockMvcWebClientBuilder
 
- 
- 
Method Details- 
mockMvcSetupCreate a newMockMvcWebClientBuilderbased on the suppliedMockMvcinstance.- Parameters:
- mockMvc- the- MockMvcinstance to use; never- null
- Returns:
- the MockMvcWebClientBuilder to customize
 
- 
webAppContextSetupCreate a newMockMvcWebClientBuilderbased on the suppliedWebApplicationContext.- Parameters:
- context- the- WebApplicationContextto create a- MockMvcinstance from; never- null
- Returns:
- the MockMvcWebClientBuilder to customize
 
- 
webAppContextSetuppublic static MockMvcWebClientBuilder webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer) Create a newMockMvcWebClientBuilderbased on the suppliedWebApplicationContextandMockMvcConfigurer.- Parameters:
- context- the- WebApplicationContextto create a- MockMvcinstance from; never- null
- configurer- the- MockMvcConfigurerto apply; never- null
- Returns:
- the MockMvcWebClientBuilder to customize
 
- 
withDelegateSupply theWebClientthat the client built by this builder should delegate to when processing non-matching requests.- Parameters:
- webClient- the- WebClientto delegate to for requests that do not match; never- null
- Returns:
- this builder for further customization
- See Also:
 
- 
buildpublic com.gargoylesoftware.htmlunit.WebClient build()Build theWebClientconfigured via this builder.The returned client will use the configured MockMvcinstance for processing any matching requests and a delegateWebClientfor all other requests.If a delegate has been explicitly configured, it will be used; otherwise, a default WebClientwill be configured as the delegate.- Returns:
- the WebClientto use
- See Also:
 
 
-