class MockMvcWebConnection : WebConnection
MockMvcWebConnection
enables MockMvc to transform a WebRequest into a WebResponse.
This is the core integration with HtmlUnit.
Example usage can be seen below.
WebClient webClient = new WebClient(); MockMvc mockMvc = ... MockMvcWebConnection webConnection = new MockMvcWebConnection(mockMvc, webClient); webClient.setWebConnection(webConnection); // Use webClient as normal ...
Author
Rob Winch
Author
Sam Brannen
Since
4.2
See Also
org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
MockMvcWebConnection(mockMvc: MockMvc, webClient: WebClient)
Create a new instance that assumes the context path of the application is For example, the URL MockMvcWebConnection(mockMvc: MockMvc, webClient: WebClient, contextPath: String)
Create a new instance with the specified context path. The path may be |
fun close(): Unit |
|
fun getResponse(webRequest: WebRequest): WebResponse |
|
fun setWebClient(webClient: WebClient): Unit |