use of org.graylog.shaded.elasticsearch7.org.apache.http.HttpHost in project jaeger-client-java by jaegertracing.
the class JaegerRequestAndResponseInterceptorIntegrationTest method testAsyncHttpClientTracing.
@Test
public void testAsyncHttpClientTracing() throws Exception {
HttpAsyncClientBuilder clientBuilder = HttpAsyncClients.custom();
CloseableHttpAsyncClient client = TracingInterceptors.addTo(clientBuilder, tracer).build();
client.start();
// Verify that parent span is on top of the stack _before_ request is made
assertEquals(parentSpan, tracer.activeSpan());
// Make a request to the async client and wait for response
client.execute(new HttpHost("localhost", mockServerRule.getPort()), new BasicHttpRequest("GET", "/testing"), new FutureCallback<org.apache.http.HttpResponse>() {
@Override
public void completed(org.apache.http.HttpResponse result) {
}
@Override
public void failed(Exception ex) {
}
@Override
public void cancelled() {
}
}).get();
// Verify that parent span is on top of the stack _after_ request is made
assertEquals(parentSpan, tracer.activeSpan());
verifyTracing(parentSpan);
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.HttpHost in project jaeger-client-java by jaegertracing.
the class JaegerRequestAndResponseInterceptorIntegrationTest method testHttpClientTracing.
@Test
public void testHttpClientTracing() throws Exception {
HttpClientBuilder clientBuilder = HttpClients.custom();
CloseableHttpClient client = TracingInterceptors.addTo(clientBuilder, tracer).build();
// Make a request to the sync client and wait for response
client.execute(new HttpHost("localhost", mockServerRule.getPort()), new BasicHttpRequest("GET", "/testing"));
verifyTracing(parentSpan);
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.HttpHost in project brave by openzipkin.
the class TracingHttpAsyncClientBuilder_HttpAdapterTest method parseServerAddress_prefersAddress.
@Test
public void parseServerAddress_prefersAddress() throws UnknownHostException {
when(request.getTarget()).thenReturn(new HttpHost(InetAddress.getByName("127.0.0.1")));
assertParsedEndpoint().isEqualTo(Endpoint.newBuilder().ip("127.0.0.1").build());
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.HttpHost in project brave by openzipkin.
the class TracingHttpAsyncClientBuilder_HttpAdapterTest method parseServerAddress_ipAndPortFromHost.
@Test
public void parseServerAddress_ipAndPortFromHost() {
when(request.getTarget()).thenReturn(new HttpHost("127.0.0.1", 9999));
assertParsedEndpoint().isEqualTo(Endpoint.newBuilder().ip("127.0.0.1").port(9999).build());
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.HttpHost in project brave by openzipkin.
the class HttpAdapterTest method parseServerAddress_acceptsHostname.
@Test
public void parseServerAddress_acceptsHostname() {
when(request.getTarget()).thenReturn(new HttpHost("127.0.0.1"));
assertParsedEndpoint().isEqualTo(Endpoint.newBuilder().ip("127.0.0.1").build());
}
Aggregations