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
MockMvcBuilderwith 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 ofAbstractMockMvcBuilderthat provides theWebApplicationContextsupplied to it as a constructor argument.The main class to import in order to access all availableMockMvcBuilders.Contract for customizing aConfigurableMockMvcBuilderin some specific way, e.g.An empty method implementation ofMockMvcConfigurer.MockMvcConfigurerthat stores and re-uses the HTTP session across multiple requests performed through the sameMockMvcinstance.AMockMvcBuilderthat accepts@Controllerregistrations 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.