Java 类org.springframework.boot.actuate.trace.WebRequestTraceFilter 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:TraceWebFilterAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public WebRequestTraceFilter webRequestLoggingFilter(BeanFactory beanFactory) {
    WebRequestTraceFilter filter = new WebRequestTraceFilter(this.traceRepository,
            this.traceProperties);
    if (this.errorAttributes != null) {
        filter.setErrorAttributes(this.errorAttributes);
    }
    return filter;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:TraceWebFilterAutoConfigurationTests.java   
@Test
public void configureFilter() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            PropertyPlaceholderAutoConfiguration.class,
            TraceRepositoryAutoConfiguration.class,
            TraceWebFilterAutoConfiguration.class);
    assertThat(context.getBean(WebRequestTraceFilter.class)).isNotNull();
    context.close();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:TraceWebFilterAutoConfigurationTests.java   
@Test
public void overrideTraceFilter() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            CustomTraceFilterConfig.class, PropertyPlaceholderAutoConfiguration.class,
            TraceRepositoryAutoConfiguration.class,
            TraceWebFilterAutoConfiguration.class);
    WebRequestTraceFilter filter = context.getBean(WebRequestTraceFilter.class);
    assertThat(filter).isInstanceOf(TestWebRequestTraceFilter.class);
    context.close();
}
项目:spring-boot-concourse    文件:TraceWebFilterAutoConfiguration.java   
@Bean
public WebRequestTraceFilter webRequestLoggingFilter(BeanFactory beanFactory) {
    WebRequestTraceFilter filter = new WebRequestTraceFilter(this.traceRepository,
            this.traceProperties);

    if (this.errorAttributes != null) {
        filter.setErrorAttributes(this.errorAttributes);
    }
    return filter;
}
项目:spring-boot-concourse    文件:TraceWebFilterAutoConfigurationTests.java   
@Test
public void configureFilter() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            PropertyPlaceholderAutoConfiguration.class,
            TraceRepositoryAutoConfiguration.class,
            TraceWebFilterAutoConfiguration.class);
    assertThat(context.getBean(WebRequestTraceFilter.class)).isNotNull();
    context.close();
}
项目:contestparser    文件:TraceWebFilterAutoConfiguration.java   
@Bean
public WebRequestTraceFilter webRequestLoggingFilter(BeanFactory beanFactory) {
    WebRequestTraceFilter filter = new WebRequestTraceFilter(this.traceRepository,
            this.traceProperties);
    filter.setDumpRequests(this.dumpRequests);

    if (this.errorAttributes != null) {
        filter.setErrorAttributes(this.errorAttributes);
    }
    return filter;
}
项目:contestparser    文件:TraceWebFilterAutoConfigurationTests.java   
@Test
public void configureFilter() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            PropertyPlaceholderAutoConfiguration.class,
            TraceRepositoryAutoConfiguration.class,
            TraceWebFilterAutoConfiguration.class);
    assertNotNull(context.getBean(WebRequestTraceFilter.class));
    context.close();
}