1- import org.testcontainers.utility.DockerImageName
2-
3- import static datadog.trace.agent.test.utils.TraceUtils.basicSpan
4- import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
5- import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
6-
71import com.redis.testcontainers.RedisContainer
82import datadog.trace.agent.test.asserts.ListWriterAssert
93import datadog.trace.agent.test.asserts.TraceAssert
@@ -21,13 +15,18 @@ import io.vertx.redis.client.Redis
2115import io.vertx.redis.client.Request
2216import io.vertx.redis.client.Response
2317import org.testcontainers.containers.wait.strategy.Wait
18+ import org.testcontainers.utility.DockerImageName
2419import spock.lang.AutoCleanup
2520import spock.lang.Shared
2621
2722import java.util.concurrent.CountDownLatch
2823import java.util.concurrent.TimeUnit
2924import java.util.function.Function
3025
26+ import static datadog.trace.agent.test.utils.TraceUtils.basicSpan
27+ import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
28+ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
29+
3130abstract class VertxRedisTestBase extends VersionedNamingTestBase {
3231
3332 @Shared
@@ -86,11 +85,12 @@ abstract class VertxRedisTestBase extends VersionedNamingTestBase {
8685 TEST_WRITER . start()
8786 }
8887
89- public <T, R> R runWithHandler (final Handler<Handler<AsyncResult<T> > > redisCommand ,
90- final Function<T, R> resultFunction = null ) {
88+ < T, R> R runWithHandler(final Handler<Handler<AsyncResult<T> > > redisCommand,
89+ final Function<T, R> resultFunction = null ) {
9190 R result = null
9291 CountDownLatch latch = new CountDownLatch (1 )
93- redisCommand. handle({ ar ->
92+ redisCommand. handle({
93+ ar ->
9494 runUnderTrace(" handler" ) {
9595 if (resultFunction) {
9696 result = resultFunction. apply(ar. result())
@@ -102,8 +102,8 @@ abstract class VertxRedisTestBase extends VersionedNamingTestBase {
102102 result
103103 }
104104
105- public <T, R> R runWithParentAndHandler (final Handler<Handler<AsyncResult<T> > > redisCommand ,
106- final Function<T, R> resultFunction = null ) {
105+ def <T, R> R runWithParentAndHandler (final Handler<Handler<AsyncResult<T> > > redisCommand ,
106+ final Function<T, R> resultFunction = null ) {
107107 R result = null
108108 def parentSpan = runUnderTrace(" parent" ) {
109109 result = runWithHandler(redisCommand, resultFunction)
@@ -160,8 +160,4 @@ abstract class VertxRedisTestBase extends VersionedNamingTestBase {
160160 List<String > responseToStrings (Response r ) {
161161 r. iterator(). collect { it. toString() }
162162 }
163-
164- public <T> T identity (T t ) {
165- return t
166- }
167163}
0 commit comments