Search in sources :

Example 1 with WebRequestTraceFilter

use of org.springframework.boot.actuate.trace.WebRequestTraceFilter in project spring-boot by spring-projects.

the class TraceWebFilterAutoConfigurationTests method overrideTraceFilter.

@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();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) WebRequestTraceFilter(org.springframework.boot.actuate.trace.WebRequestTraceFilter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 WebRequestTraceFilter (org.springframework.boot.actuate.trace.WebRequestTraceFilter)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1