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

项目:spring4-understanding    文件:FrameworkExtensionTests.java   
@Override
public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder,
        WebApplicationContext context) {
    return request -> {
        request.setUserPrincipal(mock(Principal.class));
        return request;
    };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootMockMvcBuilderCustomizer.java   
@Override
public void customize(ConfigurableMockMvcBuilder<?> builder) {
    if (this.addFilters) {
        addFilters(builder);
    }
    if (this.alwaysPrint) {
        builder.alwaysDo(MockMvcResultHandlers.print(System.out));
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootMockMvcBuilderCustomizer.java   
private void addFilters(ConfigurableMockMvcBuilder<?> builder) {
    ServletContextInitializerBeans Initializers = new ServletContextInitializerBeans(
            this.context);
    for (ServletContextInitializer initializer : Initializers) {
        if (initializer instanceof FilterRegistrationBean) {
            addFilter(builder, (FilterRegistrationBean) initializer);
        }
        if (initializer instanceof DelegatingFilterProxyRegistrationBean) {
            addFilter(builder, (DelegatingFilterProxyRegistrationBean) initializer);
        }
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootMockMvcBuilderCustomizer.java   
private void addFilter(ConfigurableMockMvcBuilder<?> builder, Filter filter,
        Collection<String> urls) {
    if (urls.isEmpty()) {
        builder.addFilters(filter);
    }
    else {
        builder.addFilter(filter, urls.toArray(new String[urls.size()]));
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:RestDocsMockMvcBuilderCustomizer.java   
@Override
public void customize(ConfigurableMockMvcBuilder<?> builder) {
    builder.apply(this.delegate);
    if (this.resultHandler != null) {
        builder.alwaysDo(this.resultHandler);
    }
}
项目:spring-boot-concourse    文件:SpringBootMockMvcBuilderCustomizer.java   
@Override
public void customize(ConfigurableMockMvcBuilder<?> builder) {
    if (this.addFilters) {
        addFilters(builder);
    }
    if (this.alwaysPrint) {
        builder.alwaysDo(MockMvcResultHandlers.print(System.out));
    }
}
项目:spring-boot-concourse    文件:SpringBootMockMvcBuilderCustomizer.java   
private void addFilters(ConfigurableMockMvcBuilder<?> builder) {
    ServletContextInitializerBeans Initializers = new ServletContextInitializerBeans(
            this.context);
    for (ServletContextInitializer initializer : Initializers) {
        if (initializer instanceof FilterRegistrationBean) {
            addFilter(builder, (FilterRegistrationBean) initializer);
        }
        if (initializer instanceof DelegatingFilterProxyRegistrationBean) {
            addFilter(builder, (DelegatingFilterProxyRegistrationBean) initializer);
        }
    }
}
项目:spring-boot-concourse    文件:SpringBootMockMvcBuilderCustomizer.java   
private void addFilter(ConfigurableMockMvcBuilder<?> builder, Filter filter,
        Collection<String> urls) {
    if (urls.isEmpty()) {
        builder.addFilters(filter);
    }
    else {
        builder.addFilter(filter, urls.toArray(new String[urls.size()]));
    }
}
项目:spring-boot-concourse    文件:RestDocsMockMvcBuilderCustomizer.java   
@Override
public void customize(ConfigurableMockMvcBuilder<?> builder) {
    builder.apply(this.delegate);
    if (this.resultHandler != null) {
        builder.alwaysDo(this.resultHandler);
    }
}
项目:spring4-understanding    文件:FrameworkExtensionTests.java   
@Override
public void afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder) {
    builder.alwaysExpect(status().isOk());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootMockMvcBuilderCustomizer.java   
private void addFilter(ConfigurableMockMvcBuilder<?> builder,
        FilterRegistrationBean registration) {
    addFilter(builder, registration.getFilter(), registration.getUrlPatterns());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootMockMvcBuilderCustomizer.java   
private void addFilter(ConfigurableMockMvcBuilder<?> builder,
        DelegatingFilterProxyRegistrationBean registration) {
    addFilter(builder, registration.getFilter(), registration.getUrlPatterns());
}
项目:spring-boot-concourse    文件:SpringBootMockMvcBuilderCustomizer.java   
private void addFilter(ConfigurableMockMvcBuilder<?> builder,
        FilterRegistrationBean registration) {
    addFilter(builder, registration.getFilter(), registration.getUrlPatterns());
}
项目:spring-boot-concourse    文件:SpringBootMockMvcBuilderCustomizer.java   
private void addFilter(ConfigurableMockMvcBuilder<?> builder,
        DelegatingFilterProxyRegistrationBean registration) {
    addFilter(builder, registration.getFilter(), registration.getUrlPatterns());
}
项目:atsy    文件:AbstractControllerTest.java   
@Override
public void afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder) {
}
项目:atsy    文件:AbstractControllerTest.java   
@Override
public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context) {
  AbstractControllerTest.this.lazySpringConstraintValidatorFactory.setDelegate(new SpringConstraintValidatorFactory(context.getAutowireCapableBeanFactory()));
  AbstractControllerTest.this.lazySpringConstraintValidatorFactory.setBeanFactory(context.getAutowireCapableBeanFactory());
  return null;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MockMvcBuilderCustomizer.java   
/**
 * Customize the given {@code builder}.
 * @param builder the builder
 */
void customize(ConfigurableMockMvcBuilder<?> builder);
项目:spring-boot-concourse    文件:MockMvcBuilderCustomizer.java   
/**
 * Customize the given {@code builder}.
 * @param builder the builder
 */
void customize(ConfigurableMockMvcBuilder<?> builder);