Java 类org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder 实例源码

项目:pact-spring-mvc    文件:PactTestBase.java   
@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();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MockMvcAutoConfiguration.java   
@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;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MvcEndpointIntegrationTests.java   
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();
}
项目:Zipkin    文件:AbstractMvcIntegrationTest.java   
@Before
public void setup() {
    ExceptionUtils.setFail(true);
    DefaultMockMvcBuilder mockMvcBuilder = MockMvcBuilders.webAppContextSetup(this.webApplicationContext);
    configureMockMvcBuilder(mockMvcBuilder);
    this.mockMvc = mockMvcBuilder.build();
}
项目:spring-boot-concourse    文件:MockMvcAutoConfiguration.java   
@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;
}
项目:spring-boot-concourse    文件:MvcEndpointIntegrationTests.java   
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();
}
项目:contestparser    文件:MvcEndpointIntegrationTests.java   
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();
}
项目:hawkbit    文件:DosFilterTest.java   
@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/**"));
}
项目:spring-cloud-sleuth    文件:AbstractMvcIntegrationTest.java   
@Before
public void setup() {
    ExceptionUtils.setFail(true);
    TestSpanContextHolder.removeCurrentSpan();
    DefaultMockMvcBuilder mockMvcBuilder = MockMvcBuilders.webAppContextSetup(this.webApplicationContext);
    configureMockMvcBuilder(mockMvcBuilder);
    this.mockMvc = mockMvcBuilder.build();
}
项目:pact-spring-mvc    文件:PactTestBase.java   
protected void initialiseMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
    // hook to allow clients to perform any custom setup on the mockMvcBuilder
}
项目:angular-spring-starter    文件:MockMvcConfig.java   
@Bean
public MockMvc mockMvc() {
    DefaultMockMvcBuilder builder = MockMvcBuilders.webAppContextSetup(wac);
    return builder.addFilters(filter)
            .build();
}
项目:funcatron    文件:SpringBootWrapper.java   
protected MockMvc getMockMvc() {
        DefaultMockMvcBuilder builder = MockMvcBuilders.webAppContextSetup(applicationContext);
return builder.build();
    }
项目:Zipkin    文件:TraceFilterIntegrationTests.java   
@Override
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
    mockMvcBuilder.addFilters(this.traceFilter);
}
项目:Zipkin    文件:MultipleHopsIntegrationTests.java   
@Override
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
    mockMvcBuilder.addFilters(this.traceFilter);
}
项目:Zipkin    文件:TraceFilterAlwaysSamplerIntegrationTests.java   
@Override
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
    mockMvcBuilder.addFilters(new TraceFilter(this.tracer, this.traceKeys,
            new NoOpSpanReporter(), this.spanExtractor, this.spanInjector,
            this.httpTraceKeysInjector));
}
项目:spring-cloud-sleuth    文件:TraceFilterIntegrationTests.java   
@Override
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
    mockMvcBuilder.addFilters(this.traceFilter);
}
项目:spring-cloud-sleuth    文件:TraceFilterAlwaysSamplerIntegrationTests.java   
@Override
protected void configureMockMvcBuilder(DefaultMockMvcBuilder mockMvcBuilder) {
    BeanFactory beanFactory = beanFactory();
    mockMvcBuilder.addFilters(new TraceFilter(beanFactory));
}
项目:Zipkin    文件:AbstractMvcIntegrationTest.java   
/**
 * 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) {
}
项目:spring-cloud-sleuth    文件:AbstractMvcIntegrationTest.java   
/**
 * 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) {
}