Consolidate duplicate play-ws tests
MODIFY
instrumentation/play-ws/play-ws-1.0/javaagent/src/test/groovy/PlayWsClientTest.groovy
instrumentation/play-ws/play-ws-1.0/javaagent/src/test/groovy/PlayWsClientTest.groovy
* SPDX-License-Identifier: Apache-2.0
*/
-import java.util.concurrent.TimeUnit
-import play.libs.ws.StandaloneWSClient
-import play.libs.ws.StandaloneWSRequest
-import play.libs.ws.StandaloneWSResponse
-import play.libs.ws.ahc.StandaloneAhcWSClient
-import scala.collection.JavaConverters
-import scala.concurrent.Await
-import scala.concurrent.ExecutionContext
-import scala.concurrent.Future
-import scala.concurrent.duration.Duration
-import spock.lang.Shared
+class PlayJavaWsClientTest extends PlayJavaWsClientTestBase {}
-class PlayJavaWsClientTest extends PlayWsClientTestBase {
- @Shared
- StandaloneWSClient wsClient
+class PlayJavaStreamedWsClientTest extends PlayJavaStreamedWsClientTestBase {}
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- StandaloneWSRequest wsRequest = wsClient.url(uri.toURL().toString()).setFollowRedirects(true)
+class PlayScalaWsClientTest extends PlayScalaWsClientTestBase {}
- headers.entrySet().each { entry -> wsRequest.addHeader(entry.getKey(), entry.getValue()) }
- StandaloneWSResponse wsResponse = wsRequest.setMethod(method).execute()
- .whenComplete({ response, throwable ->
- callback?.call()
- }).toCompletableFuture().get(5, TimeUnit.SECONDS)
-
- return wsResponse.getStatus()
- }
-
- def setupSpec() {
- wsClient = new StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayJavaStreamedWsClientTest extends PlayWsClientTestBase {
- @Shared
- StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- StandaloneWSRequest wsRequest = wsClient.url(uri.toURL().toString()).setFollowRedirects(true)
-
- headers.entrySet().each { entry -> wsRequest.addHeader(entry.getKey(), entry.getValue()) }
- StandaloneWSResponse wsResponse = wsRequest.setMethod(method).stream()
- .whenComplete({ response, throwable ->
- callback?.call()
- }).toCompletableFuture().get(5, TimeUnit.SECONDS)
-
- // The status can be ready before the body so explicitly call wait for body to be ready
- wsResponse.getBodyAsSource().runFold("", { acc, out -> "" }, materializer)
- .toCompletableFuture().get(5, TimeUnit.SECONDS)
- return wsResponse.getStatus()
- }
-
- def setupSpec() {
- wsClient = new StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayScalaWsClientTest extends PlayWsClientTestBase {
- @Shared
- play.api.libs.ws.StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- Future<play.api.libs.ws.StandaloneWSResponse> futureResponse = wsClient.url(uri.toURL().toString())
- .withMethod(method)
- .withFollowRedirects(true)
- .withHttpHeaders(JavaConverters.mapAsScalaMap(headers).toSeq())
- .execute()
- .transform({ theTry ->
- callback?.call()
- theTry
- }, ExecutionContext.global())
-
- play.api.libs.ws.StandaloneWSResponse wsResponse = Await.result(futureResponse, Duration.apply(5, TimeUnit.SECONDS))
-
- return wsResponse.status()
- }
-
- def setupSpec() {
- wsClient = new play.api.libs.ws.ahc.StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayScalaStreamedWsClientTest extends PlayWsClientTestBase {
- @Shared
- play.api.libs.ws.StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- Future<play.api.libs.ws.StandaloneWSResponse> futureResponse = wsClient.url(uri.toURL().toString())
- .withMethod(method)
- .withFollowRedirects(true)
- .withHttpHeaders(JavaConverters.mapAsScalaMap(headers).toSeq())
- .stream()
- .transform({ theTry ->
- callback?.call()
- theTry
- }, ExecutionContext.global())
-
- play.api.libs.ws.StandaloneWSResponse wsResponse = Await.result(futureResponse, Duration.apply(5, TimeUnit.SECONDS))
-
- // The status can be ready before the body so explicitly call wait for body to be ready
- Await.result(
- wsResponse.bodyAsSource().runFold("", { acc, out -> "" }, materializer),
- Duration.apply(5, TimeUnit.SECONDS))
- return wsResponse.status()
- }
-
- def setupSpec() {
- wsClient = new play.api.libs.ws.ahc.StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
+class PlayScalaStreamedWsClientTest extends PlayScalaStreamedWsClientTestBase {}

MODIFY
instrumentation/play-ws/play-ws-2.0/javaagent/src/test/groovy/PlayWsClientTest.groovy
instrumentation/play-ws/play-ws-2.0/javaagent/src/test/groovy/PlayWsClientTest.groovy
* SPDX-License-Identifier: Apache-2.0
*/
-import java.util.concurrent.TimeUnit
-import play.libs.ws.StandaloneWSClient
-import play.libs.ws.StandaloneWSRequest
-import play.libs.ws.StandaloneWSResponse
-import play.libs.ws.ahc.StandaloneAhcWSClient
-import scala.collection.JavaConverters
-import scala.concurrent.Await
-import scala.concurrent.ExecutionContext
-import scala.concurrent.Future
-import scala.concurrent.duration.Duration
-import spock.lang.Shared
+class PlayJavaWsClientTest extends PlayJavaWsClientTestBase {}
-class PlayJavaWsClientTest extends PlayWsClientTestBase {
- @Shared
- StandaloneWSClient wsClient
+class PlayJavaStreamedWsClientTest extends PlayJavaStreamedWsClientTestBase {}
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- StandaloneWSRequest wsRequest = wsClient.url(uri.toURL().toString()).setFollowRedirects(true)
+class PlayScalaWsClientTest extends PlayScalaWsClientTestBase {}
- headers.entrySet().each { entry -> wsRequest.addHeader(entry.getKey(), entry.getValue()) }
- StandaloneWSResponse wsResponse = wsRequest.setMethod(method).execute()
- .whenComplete({ response, throwable ->
- callback?.call()
- }).toCompletableFuture().get(5, TimeUnit.SECONDS)
-
- return wsResponse.getStatus()
- }
-
- def setupSpec() {
- wsClient = new StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayJavaStreamedWsClientTest extends PlayWsClientTestBase {
- @Shared
- StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- StandaloneWSRequest wsRequest = wsClient.url(uri.toURL().toString()).setFollowRedirects(true)
-
- headers.entrySet().each { entry -> wsRequest.addHeader(entry.getKey(), entry.getValue()) }
- StandaloneWSResponse wsResponse = wsRequest.setMethod(method).stream()
- .whenComplete({ response, throwable ->
- callback?.call()
- }).toCompletableFuture().get(5, TimeUnit.SECONDS)
-
- // The status can be ready before the body so explicitly call wait for body to be ready
- wsResponse.getBodyAsSource().runFold("", { acc, out -> "" }, materializer)
- .toCompletableFuture().get(5, TimeUnit.SECONDS)
- return wsResponse.getStatus()
- }
-
- def setupSpec() {
- wsClient = new StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayScalaWsClientTest extends PlayWsClientTestBase {
- @Shared
- play.api.libs.ws.StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- Future<play.api.libs.ws.StandaloneWSResponse> futureResponse = wsClient.url(uri.toURL().toString())
- .withMethod(method)
- .withFollowRedirects(true)
- .withHttpHeaders(JavaConverters.mapAsScalaMap(headers).toSeq())
- .execute()
- .transform({ theTry ->
- callback?.call()
- theTry
- }, ExecutionContext.global())
-
- play.api.libs.ws.StandaloneWSResponse wsResponse = Await.result(futureResponse, Duration.apply(5, TimeUnit.SECONDS))
-
- return wsResponse.status()
- }
-
- def setupSpec() {
- wsClient = new play.api.libs.ws.ahc.StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayScalaStreamedWsClientTest extends PlayWsClientTestBase {
- @Shared
- play.api.libs.ws.StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- Future<play.api.libs.ws.StandaloneWSResponse> futureResponse = wsClient.url(uri.toURL().toString())
- .withMethod(method)
- .withFollowRedirects(true)
- .withHttpHeaders(JavaConverters.mapAsScalaMap(headers).toSeq())
- .stream()
- .transform({ theTry ->
- callback?.call()
- theTry
- }, ExecutionContext.global())
-
- play.api.libs.ws.StandaloneWSResponse wsResponse = Await.result(futureResponse, Duration.apply(5, TimeUnit.SECONDS))
-
- // The status can be ready before the body so explicitly call wait for body to be ready
- Await.result(
- wsResponse.bodyAsSource().runFold("", { acc, out -> "" }, materializer),
- Duration.apply(5, TimeUnit.SECONDS))
- return wsResponse.status()
- }
-
- def setupSpec() {
- wsClient = new play.api.libs.ws.ahc.StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
+class PlayScalaStreamedWsClientTest extends PlayScalaStreamedWsClientTestBase {}

MODIFY
instrumentation/play-ws/play-ws-2.1/javaagent/src/test/groovy/PlayWsClientTest.groovy
instrumentation/play-ws/play-ws-2.1/javaagent/src/test/groovy/PlayWsClientTest.groovy
* SPDX-License-Identifier: Apache-2.0
*/
-import java.util.concurrent.TimeUnit
-import play.libs.ws.StandaloneWSClient
-import play.libs.ws.StandaloneWSRequest
-import play.libs.ws.StandaloneWSResponse
-import play.libs.ws.ahc.StandaloneAhcWSClient
-import scala.collection.JavaConverters
-import scala.concurrent.Await
-import scala.concurrent.ExecutionContext
-import scala.concurrent.Future
-import scala.concurrent.duration.Duration
-import spock.lang.Shared
+class PlayJavaWsClientTest extends PlayJavaWsClientTestBase {}
-class PlayJavaWsClientTest extends PlayWsClientTestBase {
- @Shared
- StandaloneWSClient wsClient
+class PlayJavaStreamedWsClientTest extends PlayJavaStreamedWsClientTestBase {}
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- StandaloneWSRequest wsRequest = wsClient.url(uri.toURL().toString()).setFollowRedirects(true)
+class PlayScalaWsClientTest extends PlayScalaWsClientTestBase {}
- headers.entrySet().each { entry -> wsRequest.addHeader(entry.getKey(), entry.getValue()) }
- StandaloneWSResponse wsResponse = wsRequest.setMethod(method).execute()
- .whenComplete({ response, throwable ->
- callback?.call()
- }).toCompletableFuture().get(5, TimeUnit.SECONDS)
-
- return wsResponse.getStatus()
- }
-
- def setupSpec() {
- wsClient = new StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayJavaStreamedWsClientTest extends PlayWsClientTestBase {
- @Shared
- StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- StandaloneWSRequest wsRequest = wsClient.url(uri.toURL().toString()).setFollowRedirects(true)
-
- headers.entrySet().each { entry -> wsRequest.addHeader(entry.getKey(), entry.getValue()) }
- StandaloneWSResponse wsResponse = wsRequest.setMethod(method).stream()
- .whenComplete({ response, throwable ->
- callback?.call()
- }).toCompletableFuture().get(5, TimeUnit.SECONDS)
-
- // The status can be ready before the body so explicitly call wait for body to be ready
- wsResponse.getBodyAsSource().runFold("", { acc, out -> "" }, materializer)
- .toCompletableFuture().get(5, TimeUnit.SECONDS)
- return wsResponse.getStatus()
- }
-
- def setupSpec() {
- wsClient = new StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayScalaWsClientTest extends PlayWsClientTestBase {
- @Shared
- play.api.libs.ws.StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- Future<play.api.libs.ws.StandaloneWSResponse> futureResponse = wsClient.url(uri.toURL().toString())
- .withMethod(method)
- .withFollowRedirects(true)
- .withHttpHeaders(JavaConverters.mapAsScalaMap(headers).toSeq())
- .execute()
- .transform({ theTry ->
- callback?.call()
- theTry
- }, ExecutionContext.global())
-
- play.api.libs.ws.StandaloneWSResponse wsResponse = Await.result(futureResponse, Duration.apply(5, TimeUnit.SECONDS))
-
- return wsResponse.status()
- }
-
- def setupSpec() {
- wsClient = new play.api.libs.ws.ahc.StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
-
-class PlayScalaStreamedWsClientTest extends PlayWsClientTestBase {
- @Shared
- play.api.libs.ws.StandaloneWSClient wsClient
-
- @Override
- int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
- Future<play.api.libs.ws.StandaloneWSResponse> futureResponse = wsClient.url(uri.toURL().toString())
- .withMethod(method)
- .withFollowRedirects(true)
- .withHttpHeaders(JavaConverters.mapAsScalaMap(headers).toSeq())
- .stream()
- .transform({ theTry ->
- callback?.call()
- theTry
- }, ExecutionContext.global())
-
- play.api.libs.ws.StandaloneWSResponse wsResponse = Await.result(futureResponse, Duration.apply(5, TimeUnit.SECONDS))
-
- // The status can be ready before the body so explicitly call wait for body to be ready
- Await.result(
- wsResponse.bodyAsSource().runFold("", { acc, out -> "" }, materializer),
- Duration.apply(5, TimeUnit.SECONDS))
- return wsResponse.status()
- }
-
- def setupSpec() {
- wsClient = new play.api.libs.ws.ahc.StandaloneAhcWSClient(asyncHttpClient, materializer)
- }
-
- def cleanupSpec() {
- wsClient?.close()
- }
-}
+class PlayScalaStreamedWsClientTest extends PlayScalaStreamedWsClientTestBase {}

MODIFY
instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWsClientTestBase.groovy
instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWsClientTestBase.groovy
* SPDX-License-Identifier: Apache-2.0
*/
-import akka.actor.ActorSystem
-import akka.stream.ActorMaterializer
-import akka.stream.ActorMaterializerSettings
-import io.opentelemetry.instrumentation.test.AgentTestTrait
-import io.opentelemetry.instrumentation.test.base.HttpClientTest
-import play.shaded.ahc.org.asynchttpclient.AsyncHttpClient
-import play.shaded.ahc.org.asynchttpclient.AsyncHttpClientConfig
-import play.shaded.ahc.org.asynchttpclient.DefaultAsyncHttpClient
-import play.shaded.ahc.org.asynchttpclient.DefaultAsyncHttpClientConfig
+import java.util.concurrent.TimeUnit
+import play.libs.ws.StandaloneWSClient
+import play.libs.ws.StandaloneWSRequest
+import play.libs.ws.StandaloneWSResponse
+import play.libs.ws.ahc.StandaloneAhcWSClient
+import scala.collection.JavaConverters
+import scala.concurrent.Await
+import scala.concurrent.ExecutionContext
+import scala.concurrent.Future
+import scala.concurrent.duration.Duration
import spock.lang.Shared
-abstract class PlayWsClientTestBase extends HttpClientTest implements AgentTestTrait {
+class PlayJavaWsClientTestBase extends PlayWsClientTestBaseBase {
@Shared
- ActorSystem system
+ StandaloneWSClient wsClient
- @Shared
- AsyncHttpClient asyncHttpClient
+ @Override
+ int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
+ StandaloneWSRequest wsRequest = wsClient.url(uri.toURL().toString()).setFollowRedirects(true)
- @Shared
- ActorMaterializer materializer
+ headers.entrySet().each { entry -> wsRequest.addHeader(entry.getKey(), entry.getValue()) }
+ StandaloneWSResponse wsResponse = wsRequest.setMethod(method).execute()
+ .whenComplete({ response, throwable ->
+ callback?.call()
+ }).toCompletableFuture().get(5, TimeUnit.SECONDS)
+
+ return wsResponse.getStatus()
+ }
def setupSpec() {
- String name = "play-ws"
- system = ActorSystem.create(name)
- ActorMaterializerSettings settings = ActorMaterializerSettings.create(system)
- materializer = ActorMaterializer.create(settings, system, name)
+ wsClient = new StandaloneAhcWSClient(asyncHttpClient, materializer)
+ }
- AsyncHttpClientConfig asyncHttpClientConfig =
- new DefaultAsyncHttpClientConfig.Builder()
- .setMaxRequestRetry(0)
- .setShutdownQuietPeriod(0)
- .setShutdownTimeout(0)
- .build()
+ def cleanupSpec() {
+ wsClient?.close()
+ }
+}
- asyncHttpClient = new DefaultAsyncHttpClient(asyncHttpClientConfig)
+class PlayJavaStreamedWsClientTestBase extends PlayWsClientTestBaseBase {
+ @Shared
+ StandaloneWSClient wsClient
+
+ @Override
+ int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
+ StandaloneWSRequest wsRequest = wsClient.url(uri.toURL().toString()).setFollowRedirects(true)
+
+ headers.entrySet().each { entry -> wsRequest.addHeader(entry.getKey(), entry.getValue()) }
+ StandaloneWSResponse wsResponse = wsRequest.setMethod(method).stream()
+ .whenComplete({ response, throwable ->
+ callback?.call()
+ }).toCompletableFuture().get(5, TimeUnit.SECONDS)
+
+ // The status can be ready before the body so explicitly call wait for body to be ready
+ wsResponse.getBodyAsSource().runFold("", { acc, out -> "" }, materializer)
+ .toCompletableFuture().get(5, TimeUnit.SECONDS)
+ return wsResponse.getStatus()
}
- def cleanupSpec() {
- system?.terminate()
+ def setupSpec() {
+ wsClient = new StandaloneAhcWSClient(asyncHttpClient, materializer)
}
- String expectedOperationName() {
- return "play-ws.request"
+ def cleanupSpec() {
+ wsClient?.close()
}
+}
+
+class PlayScalaWsClientTestBase extends PlayWsClientTestBaseBase {
+ @Shared
+ play.api.libs.ws.StandaloneWSClient wsClient
@Override
- boolean testCircularRedirects() {
- return false
+ int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
+ Future<play.api.libs.ws.StandaloneWSResponse> futureResponse = wsClient.url(uri.toURL().toString())
+ .withMethod(method)
+ .withFollowRedirects(true)
+ .withHttpHeaders(JavaConverters.mapAsScalaMap(headers).toSeq())
+ .execute()
+ .transform({ theTry ->
+ callback?.call()
+ theTry
+ }, ExecutionContext.global())
+
+ play.api.libs.ws.StandaloneWSResponse wsResponse = Await.result(futureResponse, Duration.apply(5, TimeUnit.SECONDS))
+
+ return wsResponse.status()
}
- @Override
- boolean testCallbackWithParent() {
- return false
+ def setupSpec() {
+ wsClient = new play.api.libs.ws.ahc.StandaloneAhcWSClient(asyncHttpClient, materializer)
}
+ def cleanupSpec() {
+ wsClient?.close()
+ }
+}
+
+class PlayScalaStreamedWsClientTestBase extends PlayWsClientTestBaseBase {
+ @Shared
+ play.api.libs.ws.StandaloneWSClient wsClient
+
@Override
- boolean testRemoteConnection() {
- // TODO(anuraaga): Timeouts contain ConnectException in client span instead of TimeoutException
- return false
+ int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
+ Future<play.api.libs.ws.StandaloneWSResponse> futureResponse = wsClient.url(uri.toURL().toString())
+ .withMethod(method)
+ .withFollowRedirects(true)
+ .withHttpHeaders(JavaConverters.mapAsScalaMap(headers).toSeq())
+ .stream()
+ .transform({ theTry ->
+ callback?.call()
+ theTry
+ }, ExecutionContext.global())
+
+ play.api.libs.ws.StandaloneWSResponse wsResponse = Await.result(futureResponse, Duration.apply(5, TimeUnit.SECONDS))
+
+ // The status can be ready before the body so explicitly call wait for body to be ready
+ Await.result(
+ wsResponse.bodyAsSource().runFold("", { acc, out -> "" }, materializer),
+ Duration.apply(5, TimeUnit.SECONDS))
+ return wsResponse.status()
+ }
+
+ def setupSpec() {
+ wsClient = new play.api.libs.ws.ahc.StandaloneAhcWSClient(asyncHttpClient, materializer)
+ }
+
+ def cleanupSpec() {
+ wsClient?.close()
}
}

ADD
instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWsClientTestBaseBase.groovy
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import akka.actor.ActorSystem
+import akka.stream.ActorMaterializer
+import akka.stream.ActorMaterializerSettings
+import io.opentelemetry.instrumentation.test.AgentTestTrait
+import io.opentelemetry.instrumentation.test.base.HttpClientTest
+import play.shaded.ahc.org.asynchttpclient.AsyncHttpClient
+import play.shaded.ahc.org.asynchttpclient.AsyncHttpClientConfig
+import play.shaded.ahc.org.asynchttpclient.DefaultAsyncHttpClient
+import play.shaded.ahc.org.asynchttpclient.DefaultAsyncHttpClientConfig
+import spock.lang.Shared
+
+abstract class PlayWsClientTestBaseBase extends HttpClientTest implements AgentTestTrait {
+ @Shared
+ ActorSystem system
+
+ @Shared
+ AsyncHttpClient asyncHttpClient
+
+ @Shared
+ ActorMaterializer materializer
+
+ def setupSpec() {
+ String name = "play-ws"
+ system = ActorSystem.create(name)
+ ActorMaterializerSettings settings = ActorMaterializerSettings.create(system)
+ materializer = ActorMaterializer.create(settings, system, name)
+
+ AsyncHttpClientConfig asyncHttpClientConfig =
+ new DefaultAsyncHttpClientConfig.Builder()
+ .setMaxRequestRetry(0)
+ .setShutdownQuietPeriod(0)
+ .setShutdownTimeout(0)
+ .build()
+
+ asyncHttpClient = new DefaultAsyncHttpClient(asyncHttpClientConfig)
+ }
+
+ def cleanupSpec() {
+ system?.terminate()
+ }
+
+ String expectedOperationName() {
+ return "play-ws.request"
+ }
+
+ @Override
+ boolean testCircularRedirects() {
+ return false
+ }
+
+ @Override
+ boolean testCallbackWithParent() {
+ return false
+ }
+
+ @Override
+ boolean testRemoteConnection() {
+ // TODO(anuraaga): Timeouts contain ConnectException in client span instead of TimeoutException
+ return false
+ }
+}

Consolidate duplicate play-ws tests (#2726)