Package org.springframework.test.web.servlet.setup
@NonNullApi
@NonNullFields
package org.springframework.test.web.servlet.setup
Contains built-in
MockMvcBuilder
implementations.
Use MockMvcBuilders
to access to instances of those implementations.-
ClassDescriptionAbstractMockMvcBuilder<B extends AbstractMockMvcBuilder<B>>Abstract implementation of
MockMvcBuilder
with common methods for configuring filters, default request properties, global expectations and global result actions.ConfigurableMockMvcBuilder<B extends ConfigurableMockMvcBuilder<B>>Defines common methods for building aMockMvc
.A concrete implementation ofAbstractMockMvcBuilder
that provides theWebApplicationContext
supplied to it as a constructor argument.The main class to import in order to access all availableMockMvcBuilders
.Contract for customizing aConfigurableMockMvcBuilder
in some specific way, e.g.An empty method implementation ofMockMvcConfigurer
.AMockMvcBuilder
that acceptsRouterFunction
registrations thus allowing full control over the instantiation and initialization of router functions and their dependencies similar to plain unit tests, and also making it possible to test one function at a time.MockMvcConfigurer
that stores and re-uses the HTTP session across multiple requests performed through the sameMockMvc
instance.AMockMvcBuilder
that accepts@Controller
registrations thus allowing full control over the instantiation and initialization of controllers and their dependencies similar to plain unit tests, and also making it possible to test one controller at a time.