From e9244e639845cc7a4e080bfc1a0cfc181e47e98a Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Tue, 15 Jun 2021 18:42:55 +0900 Subject: [PATCH] Directly initialize OkHttp without using test util. (#3304) * Directly initialize OkHttp without using test util. * Consistent version with smoke test --- examples/distro/instrumentation/servlet-3/build.gradle | 1 + .../instrumentation/DemoServlet3InstrumentationTest.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/distro/instrumentation/servlet-3/build.gradle b/examples/distro/instrumentation/servlet-3/build.gradle index a33a088cd5..7c4f6f7a71 100644 --- a/examples/distro/instrumentation/servlet-3/build.gradle +++ b/examples/distro/instrumentation/servlet-3/build.gradle @@ -11,6 +11,7 @@ dependencies { exclude group: 'org.eclipse.jetty', module: 'jetty-server' } + testImplementation "com.squareup.okhttp3:okhttp:3.12.12" testImplementation "javax.servlet:javax.servlet-api:3.0.1" testImplementation "org.eclipse.jetty:jetty-server:8.0.0.v20110901" testImplementation "org.eclipse.jetty:jetty-servlet:8.0.0.v20110901" diff --git a/examples/distro/instrumentation/servlet-3/src/test/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationTest.java b/examples/distro/instrumentation/servlet-3/src/test/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationTest.java index 57ac683214..bb752c07a2 100644 --- a/examples/distro/instrumentation/servlet-3/src/test/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationTest.java +++ b/examples/distro/instrumentation/servlet-3/src/test/java/com/example/javaagent/instrumentation/DemoServlet3InstrumentationTest.java @@ -4,7 +4,6 @@ import static io.opentelemetry.sdk.testing.assertj.TracesAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import io.opentelemetry.api.trace.SpanKind; -import io.opentelemetry.instrumentation.test.utils.OkHttpUtils; import io.opentelemetry.instrumentation.test.utils.PortUtils; import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension; import java.io.IOException; @@ -31,7 +30,7 @@ class DemoServlet3InstrumentationTest { static final AgentInstrumentationExtension instrumentation = AgentInstrumentationExtension .create(); - static final OkHttpClient httpClient = OkHttpUtils.client(); + static final OkHttpClient httpClient = new OkHttpClient(); static int port; static Server server;