spring-framework / org.springframework.test.web.servlet.setup

Package org.springframework.test.web.servlet.setup

Types

ConfigurableMockMvcBuilder

interface ConfigurableMockMvcBuilder<B : ConfigurableMockMvcBuilder<B>> : MockMvcBuilder

Defines common methods for building a MockMvc.

DefaultMockMvcBuilder

open class DefaultMockMvcBuilder : AbstractMockMvcBuilder<DefaultMockMvcBuilder>

A concrete implementation of AbstractMockMvcBuilder that provides the WebApplicationContext supplied to it as a constructor argument.

In addition, if the ServletContext in the supplied WebApplicationContext does not contain an entry for the WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE key, the root WebApplicationContext will be detected and stored in the ServletContext under the ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE key.

MockMvcBuilders

open class MockMvcBuilders

The main class to import in order to access all available MockMvcBuilders. Eclipse Users

Consider adding this class as a Java editor favorite. To navigate to this setting, open the Preferences and type "favorites".

MockMvcConfigurerAdapter

abstract class MockMvcConfigurerAdapter : MockMvcConfigurer

An empty method implementation of MockMvcConfigurer.

SharedHttpSessionConfigurer

open class SharedHttpSessionConfigurer : MockMvcConfigurer

MockMvcConfigurer that stores and re-uses the HTTP session across multiple requests performed through the same MockMvc instance.

Example use:

 import static org.springframework.test.web.servlet.setup.SharedHttpSessionConfigurer.sharedHttpSession; // ... MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new TestController()) .apply(sharedHttpSession()) .build(); // Use mockMvc to perform requests ...