Class SharedHttpSessionConfigurer

java.lang.Object
org.springframework.test.web.servlet.setup.SharedHttpSessionConfigurer
All Implemented Interfaces:
MockMvcConfigurer

public class SharedHttpSessionConfigurer extends Object implements 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 ...
 
Since:
5.0
Author:
Rossen Stoyanchev