Search in sources :

Example 1 with BookRestClient

use of org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient in project cxf by apache.

the class BraveTracingTest method testThatNewSpanIsCreatedWhenNotProvided.

@Test
public void testThatNewSpanIsCreatedWhenNotProvided() {
    final BookRestClient client = createRestClient();
    assertThat(client.getBooks(), hasSize(2));
    assertThat(TestSpanHandler.getAllSpans().size(), equalTo(3));
    assertThat(TestSpanHandler.getAllSpans().get(0).name(), equalTo("get books"));
    assertThat(TestSpanHandler.getAllSpans().get(1).name(), equalTo("GET /bookstore/books"));
    assertThat(TestSpanHandler.getAllSpans().get(2).name(), equalTo("GET http://localhost:" + PORT + "/bookstore/books"));
}
Also used : BookRestClient(org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient) Test(org.junit.Test)

Example 2 with BookRestClient

use of org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient in project cxf by apache.

the class BraveTracingTest method testThatNewSpanIsCreatedWhenNotProvidedWithAsyncConduit.

@Test
public void testThatNewSpanIsCreatedWhenNotProvidedWithAsyncConduit() {
    final BookRestClient client = createAsyncRestClient();
    assertThat(client.getBooks(), hasSize(2));
    assertThat(TestSpanHandler.getAllSpans().size(), equalTo(3));
    assertThat(TestSpanHandler.getAllSpans().get(0).name(), equalTo("get books"));
    assertThat(TestSpanHandler.getAllSpans().get(1).name(), equalTo("GET /bookstore/books"));
    assertThat(TestSpanHandler.getAllSpans().get(2).name(), equalTo("GET http://localhost:" + PORT + "/bookstore/books"));
}
Also used : BookRestClient(org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient) Test(org.junit.Test)

Example 3 with BookRestClient

use of org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient in project cxf by apache.

the class BraveTracingTest method testThatNewInnerSpanIsCreatedWithAsyncConduit.

@Test
public void testThatNewInnerSpanIsCreatedWithAsyncConduit() {
    final ScopedSpan span = brave.tracer().startScopedSpan("calling book service");
    try {
        final BookRestClient client = createAsyncRestClient();
        assertThat(client.getBooks(), hasSize(2));
    } finally {
        span.finish();
    }
    assertThat(TestSpanHandler.getAllSpans().size(), equalTo(4));
    assertThat(TestSpanHandler.getAllSpans().get(0).name(), equalTo("get books"));
    assertThat(TestSpanHandler.getAllSpans().get(1).name(), equalTo("GET /bookstore/books"));
    assertThat(TestSpanHandler.getAllSpans().get(2).name(), equalTo("GET http://localhost:" + PORT + "/bookstore/books"));
    assertThat(TestSpanHandler.getAllSpans().get(3).name(), equalTo("calling book service"));
}
Also used : BookRestClient(org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient) ScopedSpan(brave.ScopedSpan) Test(org.junit.Test)

Example 4 with BookRestClient

use of org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient in project cxf by apache.

the class BraveTracingTest method testThatNewInnerSpanIsCreated.

@Test
public void testThatNewInnerSpanIsCreated() {
    final ScopedSpan span = brave.tracer().startScopedSpan("calling book service");
    try {
        final BookRestClient client = createRestClient();
        assertThat(client.getBooks(), hasSize(2));
    } finally {
        span.finish();
    }
    assertThat(TestSpanHandler.getAllSpans().size(), equalTo(4));
    assertThat(TestSpanHandler.getAllSpans().get(0).name(), equalTo("get books"));
    assertThat(TestSpanHandler.getAllSpans().get(1).name(), equalTo("GET /bookstore/books"));
    assertThat(TestSpanHandler.getAllSpans().get(2).name(), equalTo("GET http://localhost:" + PORT + "/bookstore/books"));
    assertThat(TestSpanHandler.getAllSpans().get(3).name(), equalTo("calling book service"));
}
Also used : BookRestClient(org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient) ScopedSpan(brave.ScopedSpan) Test(org.junit.Test)

Aggregations

BookRestClient (org.apache.cxf.systest.microprofile.rest.client.tracing.BookRestClient)4 Test (org.junit.Test)4 ScopedSpan (brave.ScopedSpan)2