public class MockMvcWebClientBuilder extends MockMvcWebConnectionBuilderSupport<MockMvcWebClientBuilder>
Modifier | Constructor and Description |
---|---|
protected |
MockMvcWebClientBuilder(org.springframework.test.web.servlet.MockMvc mockMvc) |
protected |
MockMvcWebClientBuilder(org.springframework.web.context.WebApplicationContext context) |
protected |
MockMvcWebClientBuilder(org.springframework.web.context.WebApplicationContext context,
org.springframework.test.web.servlet.setup.MockMvcConfigurer configurer) |
Modifier and Type | Method and Description |
---|---|
com.gargoylesoftware.htmlunit.WebClient |
configureWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
Creates a WebClient that uses the provided MockMvc for any matching requests and the
provided WebClient for any other request.
|
com.gargoylesoftware.htmlunit.WebClient |
createWebClient()
Creates a WebClient that uses the provided MockMvc for any matching requests and a
WebClient with all the default settings for any other request.
|
static MockMvcWebClientBuilder |
mockMvcSetup(org.springframework.test.web.servlet.MockMvc mockMvc)
Creates a new instance with a MockMvc instance.
|
static MockMvcWebClientBuilder |
webAppContextSetup(org.springframework.web.context.WebApplicationContext context)
Creates a new instance with a WebApplicationContext.
|
static MockMvcWebClientBuilder |
webAppContextSetup(org.springframework.web.context.WebApplicationContext context,
org.springframework.test.web.servlet.setup.MockMvcConfigurer configurer)
Creates a new instance using a WebApplicationContext
|
alwaysUseMockMvc, contextPath, createConnection, useMockMvc, useMockMvcForHosts
protected MockMvcWebClientBuilder(org.springframework.test.web.servlet.MockMvc mockMvc)
protected MockMvcWebClientBuilder(org.springframework.web.context.WebApplicationContext context)
protected MockMvcWebClientBuilder(org.springframework.web.context.WebApplicationContext context, org.springframework.test.web.servlet.setup.MockMvcConfigurer configurer)
public static MockMvcWebClientBuilder webAppContextSetup(org.springframework.web.context.WebApplicationContext context)
context
- the WebApplicationContext to use. Cannot be null.public static MockMvcWebClientBuilder webAppContextSetup(org.springframework.web.context.WebApplicationContext context, org.springframework.test.web.servlet.setup.MockMvcConfigurer configurer)
context
- the WebApplicationContext to create a MockMvc instance from.configurer
- the MockMvcConfigurer to apply
Cannot be null.public static MockMvcWebClientBuilder mockMvcSetup(org.springframework.test.web.servlet.MockMvc mockMvc)
mockMvc
- the MockMvc to use. Cannot be null.public com.gargoylesoftware.htmlunit.WebClient createWebClient()
public com.gargoylesoftware.htmlunit.WebClient configureWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
webClient
- The WebClient to delegate to for requests that do not match. Cannot be null.