Closed JJonesAtAvaya closed 5 years ago
When unit tests touch code that use opentrace spans, they are failing with abstraction errors:
one example:
@Test public void testAThing() throws Exception { final Span span = tracer.buildSpan("test").start() .setOperationName("test") .setTag("key", "value") .log("event") .log(singletonMap("key", "value")); try (final Scope ignored = tracer.activateSpan(span)) { int foo = 1; int bar = foo + 1; } // fails with: java.lang.AbstractMethodError: io.opentracing.util.AutoFinishScopeManager.activeSpan()Lio/opentracing/Span; }
make sure you're using consistent versions of opentracing artifacts.
I want to close this as I figured out what to do
Just add a @Before method and set the GlobalTracer to MockTracer
When unit tests touch code that use opentrace spans, they are failing with abstraction errors:
one example: