接口的使用
cn.taketoday.test.web.servlet.setup.ConfigurableMockMvcBuilder
程序包
说明
Support for testing Web MVC applications via
WebTestClient
with MockMvc for server request
handling.Contains built-in
MockMvcBuilder implementations.-
cn.taketoday.test.web.servlet.client中ConfigurableMockMvcBuilder的使用
修饰符和类型方法说明protected abstract ConfigurableMockMvcBuilder<?>AbstractMockMvcServerSpec.getMockMvcBuilder()Return the concreteConfigurableMockMvcBuilderto delegate configuration methods and to use to create theMockMvc.protected ConfigurableMockMvcBuilder<?>ApplicationContextMockMvcSpec.getMockMvcBuilder()StandaloneMockMvcSpec.getMockMvcBuilder() -
cn.taketoday.test.web.servlet.setup中ConfigurableMockMvcBuilder的使用
修饰符和类型接口说明interfaceConfigurableMockMvcBuilder<B extends ConfigurableMockMvcBuilder<B>>Defines common methods for building aMockMvc.修饰符和类型类说明classAbstractMockMvcBuilder<B extends AbstractMockMvcBuilder<B>>Abstract implementation ofMockMvcBuilderwith common methods for configuring filters, default request properties, global expectations and global result actions.classA concrete implementation ofAbstractMockMvcBuilderthat provides theWebApplicationContextsupplied to it as a constructor argument.classAMockMvcBuilderthat 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.修饰符和类型方法说明default voidMockMvcConfigurer.afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder) Invoked immediately when thisMockMvcConfigureris added viaapply(cn.taketoday.test.web.servlet.setup.MockMvcConfigurer).voidMockMvcConfigurerAdapter.afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder) voidSharedHttpSessionConfigurer.afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder) default RequestPostProcessorMockMvcConfigurer.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.MockMvcConfigurerAdapter.beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, cn.taketoday.web.servlet.WebApplicationContext cxt) SharedHttpSessionConfigurer.beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, cn.taketoday.web.servlet.WebApplicationContext context)