use of brave.handler.FinishedSpanHandler in project brave by openzipkin.
the class TracingTest method finishedSpanHandler_affectsAlwaysSampleLocal.
/**
* This ensures deprecated overloads of {@link FinishedSpanHandler#alwaysSampleLocal()} are
* considered.
*/
@Test
public void finishedSpanHandler_affectsAlwaysSampleLocal() {
FinishedSpanHandler one = mock(FinishedSpanHandler.class);
when(one.alwaysSampleLocal()).thenReturn(false);
FinishedSpanHandler two = mock(FinishedSpanHandler.class);
when(two.alwaysSampleLocal()).thenReturn(true);
try (Tracing tracing = Tracing.newBuilder().addSpanHandler(one).addSpanHandler(two).build()) {
assertThat(tracing.tracer().alwaysSampleLocal).isTrue();
}
}
Aggregations