Package | Description |
---|---|
org.springframework.test.web.servlet |
Contains server-side support for testing Spring MVC applications.
|
org.springframework.test.web.servlet.client |
Support for testing Spring MVC applications via
WebTestClient
with MockMvc for server request
handling. |
org.springframework.test.web.servlet.request |
Contains built-in
RequestBuilder
implementations. |
org.springframework.test.web.servlet.setup |
Contains built-in
MockMvcBuilder implementations. |
Modifier and Type | Interface and Description |
---|---|
interface |
SmartRequestBuilder
Extended variant of a
RequestBuilder that applies its
org.springframework.test.web.servlet.request.RequestPostProcessors
as a separate step from the buildRequest(javax.servlet.ServletContext) method. |
Modifier and Type | Method and Description |
---|---|
protected MockMvc |
MockMvcBuilderSupport.createMockMvc(Filter[] filters,
MockServletConfig servletConfig,
WebApplicationContext webAppContext,
RequestBuilder defaultRequestBuilder,
Charset defaultResponseCharacterEncoding,
List<ResultMatcher> globalResultMatchers,
List<ResultHandler> globalResultHandlers,
List<DispatcherServletCustomizer> dispatcherServletCustomizers)
Delegates to
MockMvcBuilderSupport.createMockMvc(Filter[], MockServletConfig, WebApplicationContext, RequestBuilder, List, List, List)
for creation of the MockMvc instance and configures that instance
with the supplied defaultResponseCharacterEncoding . |
protected MockMvc |
MockMvcBuilderSupport.createMockMvc(Filter[] filters,
MockServletConfig servletConfig,
WebApplicationContext webAppContext,
RequestBuilder defaultRequestBuilder,
List<ResultMatcher> globalResultMatchers,
List<ResultHandler> globalResultHandlers,
List<DispatcherServletCustomizer> dispatcherServletCustomizers) |
ResultActions |
MockMvc.perform(RequestBuilder requestBuilder)
Perform a request and return a type that allows chaining further
actions, such as asserting expectations, on the result.
|
Modifier and Type | Method and Description |
---|---|
<T extends B> |
MockMvcWebTestClient.MockMvcServerSpec.defaultRequest(RequestBuilder requestBuilder)
Define default request properties that should be merged into all
performed requests such that input from the client request override
the default properties defined here.
|
Modifier and Type | Interface and Description |
---|---|
interface |
ConfigurableSmartRequestBuilder<B extends ConfigurableSmartRequestBuilder<B>>
An extension of
SmartRequestBuilder that can be configured with RequestPostProcessors . |
Modifier and Type | Class and Description |
---|---|
class |
MockHttpServletRequestBuilder
Default builder for
MockHttpServletRequest required as input to
perform requests in MockMvc . |
class |
MockMultipartHttpServletRequestBuilder
Default builder for
MockMultipartHttpServletRequest . |
Modifier and Type | Method and Description |
---|---|
static RequestBuilder |
MockMvcRequestBuilders.asyncDispatch(MvcResult mvcResult)
Create a
RequestBuilder for an async dispatch from the
MvcResult of the request that started async processing. |
Modifier and Type | Method and Description |
---|---|
<T extends B> |
ConfigurableMockMvcBuilder.defaultRequest(RequestBuilder requestBuilder)
Define default request properties that should be merged into all
performed requests.
|
<T extends B> |
AbstractMockMvcBuilder.defaultRequest(RequestBuilder requestBuilder) |