use of com.uber.jaeger.baggage.BaggageRestrictionManager in project jaeger-client-java by jaegertracing.
the class SpanTest method testSetAndGetBaggageItem.
@Test
public void testSetAndGetBaggageItem() {
final String service = "SamplerTest";
final BaggageRestrictionManager mgr = Mockito.mock(DefaultBaggageRestrictionManager.class);
tracer = new Tracer.Builder(service, reporter, new ConstSampler(true)).withClock(clock).withBaggageRestrictionManager(mgr).build();
span = (Span) tracer.buildSpan("some-operation").start();
final String key = "key";
final String value = "value";
when(mgr.getRestriction(service, key)).thenReturn(Restriction.of(true, 10));
span.setBaggageItem(key, "value");
verify(mgr).getRestriction(service, key);
assertEquals(value, span.getBaggageItem(key));
}
Aggregations