Trying to make tests less brittle

This commit is contained in:
Marcin Grzejszczak
2020-03-31 16:05:14 +02:00
parent 32e915dae4
commit 4063c129b3

View File

@@ -23,6 +23,7 @@ import brave.handler.MutableSpan;
import brave.propagation.TraceContext;
import brave.sampler.Sampler;
import org.assertj.core.api.BDDAssertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import zipkin2.reporter.Reporter;
@@ -39,9 +40,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
/**
* @author Marcin Grzejszczak
*/
@SpringBootTest(
classes = FinishedSpanHandlerTests.FinishedSpanHandlerAspectTestsConfig.class,
webEnvironment = NONE)
@SpringBootTest(classes = FinishedSpanHandlerTests.FinishedSpanHandlerAspectTestsConfig.class, webEnvironment = NONE)
public class FinishedSpanHandlerTests {
@Autowired
@@ -50,6 +49,11 @@ public class FinishedSpanHandlerTests {
@Autowired
Tracer tracer;
@BeforeEach
public void setup() {
this.reporter.clear();
}
@Test
public void should_adjust_span_twice_before_reporting() {
Span hello = this.tracer.nextSpan().name("hello").start();