use of brave.sampler.Sampler in project brave by openzipkin.
the class RpcClientHandlerTest method handleSend_traceIdSamplerSpecialCased.
@Test
public void handleSend_traceIdSamplerSpecialCased() {
Sampler sampler = mock(Sampler.class);
init(httpTracingBuilder(tracingBuilder().sampler(sampler)).clientSampler(SamplerFunctions.deferDecision()));
assertThat(handler.handleSend(request).isNoop()).isTrue();
verify(sampler).isSampled(anyLong());
}
use of brave.sampler.Sampler in project brave by openzipkin.
the class RpcServerHandlerTest method handleReceive_neverSamplerSpecialCased.
@Test
public void handleReceive_neverSamplerSpecialCased() {
Sampler sampler = mock(Sampler.class);
init(httpTracingBuilder(tracingBuilder().sampler(sampler)).serverSampler(SamplerFunctions.neverSample()));
assertThat(handler.handleReceive(request).isNoop()).isTrue();
verifyNoMoreInteractions(sampler);
}
Aggregations