类 SharedHttpSessionConfigurer

  • 所有已实现的接口:
    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 ...
     
    从以下版本开始:
    5.0
    作者:
    Rossen Stoyanchev