use of org.apache.cxf.systest.brave.BraveTestSupport.SpanId in project cxf by apache.
the class BraveTracingTest method testThatNewInnerSpanIsCreatedUsingAsyncInvocation.
@Test
public void testThatNewInnerSpanIsCreatedUsingAsyncInvocation() {
final SpanId spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/books/async"), spanId).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSpanReporter.getAllSpans().size(), equalTo(2));
assertThat(TestSpanReporter.getAllSpans().get(1).name, equalTo("get /bookstore/books/async"));
assertThat(TestSpanReporter.getAllSpans().get(0).name, equalTo("processing books"));
assertThat(TestSpanReporter.getAllSpans().get(0).parentId, not(nullValue()));
assertThat(TestSpanReporter.getAllSpans().get(0).parentId, equalTo(TestSpanReporter.getAllSpans().get(1).id));
assertThatTraceIsPresent(r, spanId);
}
use of org.apache.cxf.systest.brave.BraveTestSupport.SpanId in project cxf by apache.
the class BraveTracingTest method testThatInnerSpanIsCreatedUsingPseudoAsyncInvocation.
@Test
public void testThatInnerSpanIsCreatedUsingPseudoAsyncInvocation() {
final SpanId spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/books/pseudo-async"), spanId).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSpanReporter.getAllSpans().size(), equalTo(2));
assertThat(TestSpanReporter.getAllSpans().get(1).name, equalTo("get /bookstore/books/pseudo-async"));
assertThat(TestSpanReporter.getAllSpans().get(0).name, equalTo("processing books"));
assertThatTraceIsPresent(r, spanId);
}