spring-framework / org.springframework.test.web.servlet.htmlunit / MockMvcWebConnection / <init>

<init>

MockMvcWebConnection(mockMvc: MockMvc, webClient: WebClient)

Create a new instance that assumes the context path of the application is "" (i.e., the root context).

For example, the URL http://localhost/test/this would use "" as the context path.

Parameters

mockMvc - the MockMvc instance to use; never null

webClient - the WebClient to use. never null

MockMvcWebConnection(mockMvc: MockMvc, webClient: WebClient, contextPath: String)

Create a new instance with the specified context path.

The path may be null in which case the first path segment of the URL is turned into the contextPath. Otherwise it must conform to javax.servlet.http.HttpServletRequest#getContextPath() which states that it can be an empty string and otherwise must start with a "/" character and not end with a "/" character.

Parameters

mockMvc - the MockMvc instance to use (never null)

webClient - the WebClient to use (never null)

contextPath - the contextPath to use