类 SharedHttpSessionConfigurer
java.lang.Object
cn.taketoday.test.web.servlet.setup.SharedHttpSessionConfigurer
- 所有已实现的接口:
MockMvcConfigurer
MockMvcConfigurer that stores and re-uses the HTTP session across
multiple requests performed through the same MockMvc instance.
Example use:
import static cn.taketoday.test.web.servlet.setup.SharedHttpSessionConfigurer.sharedHttpSession;
// ...
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new TestController())
.apply(sharedHttpSession())
.build();
// Use mockMvc to perform requests ...
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidafterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder) Invoked immediately when thisMockMvcConfigureris added viaConfigurableMockMvcBuilder.apply(cn.taketoday.test.web.servlet.setup.MockMvcConfigurer).beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, cn.taketoday.web.servlet.WebApplicationContext context) Invoked when the MockMvc instance is about to be created with the MockMvc builder and the Infra WebApplicationContext that will be passed to theDispatcherServlet.static SharedHttpSessionConfigurer
-
字段详细资料
-
session
@Nullable private jakarta.servlet.http.HttpSession session
-
-
构造器详细资料
-
SharedHttpSessionConfigurer
public SharedHttpSessionConfigurer()
-
-
方法详细资料
-
afterConfigurerAdded
从接口复制的说明:MockMvcConfigurerInvoked immediately when thisMockMvcConfigureris added viaConfigurableMockMvcBuilder.apply(cn.taketoday.test.web.servlet.setup.MockMvcConfigurer).- 指定者:
afterConfigurerAdded在接口中MockMvcConfigurer- 参数:
builder- the builder for the MockMvc
-
beforeMockMvcCreated
public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, cn.taketoday.web.servlet.WebApplicationContext context) 从接口复制的说明:MockMvcConfigurerInvoked when the MockMvc instance is about to be created with the MockMvc builder and the Infra WebApplicationContext that will be passed to theDispatcherServlet.- 指定者:
beforeMockMvcCreated在接口中MockMvcConfigurer- 参数:
builder- the builder for the MockMvccontext- the Infra configuration- 返回:
- a post processor to be applied to every request performed
through the
MockMvcinstance.
-