CurrentSpanCustomizer implements SpanCustomizer { @Override public SpanCustomizer annotate(String value) { return tracer.currentSpanCustomizer().annotate(value); } CurrentSpanCustomizer(Tracing tracing); static CurrentSpanCustomizer create(Tracing tracing); @Override SpanCustomizer name(String name); @Override SpanCustomizer tag(String key, String value); @Override SpanCustomizer annotate(String value);  }
@Test public void annotate() { span.start(); try (SpanInScope ws = tracing.tracer().withSpanInScope(span)) { spanCustomizer.annotate("foo"); } span.flush(); assertThat(spans.get(0).annotations()) .extracting(Map.Entry::getValue) .containsExactly("foo"); }
@Test public void annotate_when_no_current_span() { spanCustomizer.annotate("foo"); }