Merge branch '2.1.x'

This commit is contained in:
Marcin Grzejszczak
2019-04-17 08:05:31 +04:00

View File

@@ -72,6 +72,7 @@ public class TracingOnScheduledTests {
}
@Test
@DirtiesContext
public void should_have_span_set_after_scheduled_method_has_been_executed() {
await().atMost(10, SECONDS).untilAsserted(() -> {
then(this.beanWithScheduledMethod.isExecuted()).isTrue();
@@ -110,8 +111,9 @@ public class TracingOnScheduledTests {
then(storedSpan).isNotNull();
then(storedSpan.context().traceId()).isNotNull();
zipkin2.Span foundSpan = this.reporter.getSpans().stream()
.filter(span -> !span.tags().containsKey("error")).findFirst()
.orElseThrow(() -> new AssertionError("Span is missing"));
.filter(span -> !span.tags().containsKey("error")
&& span.tags().containsValue("TestBeanWithScheduledMethod"))
.findFirst().orElseThrow(() -> new AssertionError("Span is missing"));
then(foundSpan.tags()).contains(
new AbstractMap.SimpleEntry<>("class", "TestBeanWithScheduledMethod"),
new AbstractMap.SimpleEntry<>("method", "scheduledMethod"));