• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DefaultMockMvcBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder的典型用法代码示例。如果您正苦于以下问题:Java DefaultMockMvcBuilder类的具体用法?Java DefaultMockMvcBuilder怎么用?Java DefaultMockMvcBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultMockMvcBuilder类属于org.springframework.test.web.servlet.setup包,在下文中一共展示了DefaultMockMvcBuilder类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setup

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Before
public void setup() {
    DefaultMockMvcBuilder mockMvcBuilder = MockMvcBuilders.webAppContextSetup(wac);

    WithSpringSecurity withSpringSecurityAnnotation = this.getClass().getAnnotation(WithSpringSecurity.class);

    if (withSpringSecurityAnnotation != null) {
        mockMvcBuilder.apply(springSecurity());
    }

    initialiseMockMvcBuilder(mockMvcBuilder);
    mockMvc = mockMvcBuilder.build();
}
 
开发者ID:tyro,项目名称:pact-spring-mvc,代码行数:14,代码来源:PactTestBase.java


示例2: mockMvcBuilder

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(MockMvcBuilder.class)
public DefaultMockMvcBuilder mockMvcBuilder(
		List<MockMvcBuilderCustomizer> customizers) {
	DefaultMockMvcBuilder builder = MockMvcBuilders.webAppContextSetup(this.context);
	for (MockMvcBuilderCustomizer customizer : customizers) {
		customizer.customize(builder);
	}
	return builder;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:MockMvcAutoConfiguration.java


示例3: doCreateMockMvc

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
private MockMvc doCreateMockMvc(MockMvcConfigurer... configurers) {
	this.context.setServletContext(new MockServletContext());
	this.context.refresh();
	DefaultMockMvcBuilder builder = MockMvcBuilders.webAppContextSetup(this.context);
	for (MockMvcConfigurer configurer : configurers) {
		builder.apply(configurer);
	}
	return builder.build();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:MvcEndpointIntegrationTests.java


示例4: setup

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Before
public void setup() {
	ExceptionUtils.setFail(true);
	DefaultMockMvcBuilder mockMvcBuilder = MockMvcBuilders.webAppContextSetup(this.webApplicationContext);
	configureMockMvcBuilder(mockMvcBuilder);
	this.mockMvc = mockMvcBuilder.build();
}
 
开发者ID:reshmik,项目名称:Zipkin,代码行数:8,代码来源:AbstractMvcIntegrationTest.java


示例5: createMvcWebAppContext

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Override
protected DefaultMockMvcBuilder createMvcWebAppContext(final WebApplicationContext context) {
    return MockMvcBuilders.webAppContextSetup(context)
            .addFilter(new DosFilter(null, 10, 10, "127\\.0\\.0\\.1|\\[0:0:0:0:0:0:0:1\\]", "(^192\\.168\\.)",
                    "X-Forwarded-For"))
            .addFilter(new ExcludePathAwareShallowETagFilter(
                    "/rest/v1/softwaremodules/{smId}/artifacts/{artId}/download",
                    "/{tenant}/controller/v1/{controllerId}/softwaremodules/{softwareModuleId}/artifacts/**",
                    "/api/v1/downloadserver/**"));
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:11,代码来源:DosFilterTest.java


示例6: setup

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Before
public void setup() {
	ExceptionUtils.setFail(true);
	TestSpanContextHolder.removeCurrentSpan();
	DefaultMockMvcBuilder mockMvcBuilder = MockMvcBuilders.webAppContextSetup(this.webApplicationContext);
	configureMockMvcBuilder(mockMvcBuilder);
	this.mockMvc = mockMvcBuilder.build();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:9,代码来源:AbstractMvcIntegrationTest.java


示例7: initialiseMockMvcBuilder

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
protected void initialiseMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
    // hook to allow clients to perform any custom setup on the mockMvcBuilder
}
 
开发者ID:tyro,项目名称:pact-spring-mvc,代码行数:4,代码来源:PactTestBase.java


示例8: mockMvc

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Bean
public MockMvc mockMvc() {
    DefaultMockMvcBuilder builder = MockMvcBuilders.webAppContextSetup(wac);
    return builder.addFilters(filter)
            .build();
}
 
开发者ID:bfwg,项目名称:angular-spring-starter,代码行数:7,代码来源:MockMvcConfig.java


示例9: getMockMvc

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
protected MockMvc getMockMvc() {
        DefaultMockMvcBuilder builder = MockMvcBuilders.webAppContextSetup(applicationContext);
return builder.build();
    }
 
开发者ID:funcatron,项目名称:funcatron,代码行数:5,代码来源:SpringBootWrapper.java


示例10: configureMockMvcBuilder

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Override
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
	mockMvcBuilder.addFilters(this.traceFilter);
}
 
开发者ID:reshmik,项目名称:Zipkin,代码行数:5,代码来源:TraceFilterIntegrationTests.java


示例11: configureMockMvcBuilder

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Override
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
	mockMvcBuilder.addFilters(new TraceFilter(this.tracer, this.traceKeys,
			new NoOpSpanReporter(), this.spanExtractor, this.spanInjector,
			this.httpTraceKeysInjector));
}
 
开发者ID:reshmik,项目名称:Zipkin,代码行数:7,代码来源:TraceFilterAlwaysSamplerIntegrationTests.java


示例12: configureMockMvcBuilder

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
@Override
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
	BeanFactory beanFactory = beanFactory();
	mockMvcBuilder.addFilters(new TraceFilter(beanFactory));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:6,代码来源:TraceFilterAlwaysSamplerIntegrationTests.java


示例13: configureMockMvcBuilder

import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; //导入依赖的package包/类
/**
 * Override in a subclass to modify mockMvcBuilder configuration (e.g. add filter).
 * <p>
 * The method from super class should be called.
 */
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
}
 
开发者ID:reshmik,项目名称:Zipkin,代码行数:8,代码来源:AbstractMvcIntegrationTest.java



注:本文中的org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DescribeVolumesRequest类代码示例发布时间:2022-05-22
下一篇:
Java ZStream类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap