use of org.pjsip.pjsua2.Endpoint in project zipkin by openzipkin.
the class ITSpanStore method getTraces_multipleAnnotationsBecomeAndFilter.
@Test
protected void getTraces_multipleAnnotationsBecomeAndFilter(TestInfo testInfo) throws Exception {
String testSuffix = testSuffix(testInfo);
Endpoint frontend = suffixServiceName(TestObjects.FRONTEND, testSuffix);
Span foo = Span.newBuilder().traceId(newTraceId()).name("call1").id(1).timestamp((TODAY + 1) * 1000L).localEndpoint(frontend).addAnnotation((TODAY + 1) * 1000L, "foo").build();
// would be foo bar, except lexicographically bar precedes foo
Span barAndFoo = Span.newBuilder().traceId(newTraceId()).name("call2").id(2).timestamp((TODAY + 2) * 1000L).localEndpoint(frontend).addAnnotation((TODAY + 2) * 1000L, "bar").addAnnotation((TODAY + 2) * 1000L, "foo").build();
Span fooAndBazAndQux = Span.newBuilder().traceId(newTraceId()).name("call3").id(3).timestamp((TODAY + 3) * 1000L).localEndpoint(frontend).addAnnotation((TODAY + 3) * 1000L, "foo").putTag("baz", "qux").build();
Span barAndFooAndBazAndQux = Span.newBuilder().traceId(newTraceId()).name("call4").id(4).timestamp((TODAY + 4) * 1000L).localEndpoint(frontend).addAnnotation((TODAY + 4) * 1000L, "bar").addAnnotation((TODAY + 4) * 1000L, "foo").putTag("baz", "qux").build();
accept(foo, barAndFoo, fooAndBazAndQux, barAndFooAndBazAndQux);
assertGetTracesReturns(requestBuilder().serviceName(frontend.serviceName()).parseAnnotationQuery("foo").build(), asList(foo), asList(barAndFoo), asList(fooAndBazAndQux), asList(barAndFooAndBazAndQux));
assertGetTracesReturns(requestBuilder().serviceName(frontend.serviceName()).parseAnnotationQuery("foo and bar").build(), asList(barAndFoo), asList(barAndFooAndBazAndQux));
assertGetTracesReturns(requestBuilder().serviceName(frontend.serviceName()).parseAnnotationQuery("foo and bar and baz=qux").build(), asList(barAndFooAndBazAndQux));
// ensure we can search only by tag key
assertGetTracesReturns(requestBuilder().serviceName(frontend.serviceName()).parseAnnotationQuery("baz").build(), asList(fooAndBazAndQux), asList(barAndFooAndBazAndQux));
}
Aggregations