Search in sources :

Example 1 with FinishedSpanHandler

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();
    }
}
Also used : FinishedSpanHandler(brave.handler.FinishedSpanHandler) Test(org.junit.Test)

Aggregations

FinishedSpanHandler (brave.handler.FinishedSpanHandler)1 Test (org.junit.Test)1