use of org.springframework.cloud.sleuth.autoconfig.SleuthProperties in project spring-cloud-gcp by spring-cloud.
the class StackdriverTraceAutoConfigurationTests method test.
@Test
public void test() {
this.contextRunner.run(context -> {
SleuthProperties sleuthProperties = context.getBean(SleuthProperties.class);
assertThat(sleuthProperties.isTraceId128()).isTrue();
assertThat(sleuthProperties.isSupportsJoin()).isFalse();
Reporter<zipkin2.Span> reporter = context.getBean(Reporter.class);
assertThat(reporter).isInstanceOf(StackdriverTraceReporter.class);
Tracer tracer = context.getBean(Tracer.class);
Span span = tracer.newTrace().start().kind(Span.Kind.CLIENT).name("test").start();
span.finish();
// There should be one trace received
MockConfiguration configuration = context.getBean(MockConfiguration.class);
assertThat(configuration.tracesList.size()).isEqualTo(1);
Traces traces = configuration.tracesList.get(0);
assertThat(traces.getTracesCount()).isEqualTo(1);
Trace trace = traces.getTraces(0);
assertThat(trace.getSpansCount()).isEqualTo(1);
TraceSpan traceSpan = trace.getSpans(0);
});
}
Aggregations