diff --git a/instrumentation/spring-webflux-5/src/test/groovy/SingleThreadedSpringWebfluxTest.groovy b/instrumentation/spring-webflux-5/src/test/groovy/SingleThreadedSpringWebfluxTest.groovy index 95d8e18f13..7712ae03c5 100644 --- a/instrumentation/spring-webflux-5/src/test/groovy/SingleThreadedSpringWebfluxTest.groovy +++ b/instrumentation/spring-webflux-5/src/test/groovy/SingleThreadedSpringWebfluxTest.groovy @@ -1,10 +1,10 @@ -import io.opentelemetry.test.instrumentation.springwebflux.server.SpringWebFluxTestApplication import org.springframework.boot.test.context.SpringBootTest import org.springframework.boot.test.context.TestConfiguration import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory import org.springframework.boot.web.embedded.netty.NettyServerCustomizer import org.springframework.context.annotation.Bean import reactor.ipc.netty.resources.LoopResources +import server.SpringWebFluxTestApplication /** * Run all Webflux tests under netty event loop having only 1 thread. diff --git a/instrumentation/spring-webflux-5/src/test/groovy/SpringWebfluxTest.groovy b/instrumentation/spring-webflux-5/src/test/groovy/SpringWebfluxTest.groovy index 9aa30374b1..893e925483 100644 --- a/instrumentation/spring-webflux-5/src/test/groovy/SpringWebfluxTest.groovy +++ b/instrumentation/spring-webflux-5/src/test/groovy/SpringWebfluxTest.groovy @@ -3,10 +3,6 @@ import io.opentelemetry.auto.instrumentation.api.SpanTypes import io.opentelemetry.auto.instrumentation.api.Tags import io.opentelemetry.auto.test.AgentTestRunner import io.opentelemetry.auto.test.utils.OkHttpUtils -import io.opentelemetry.test.instrumentation.springwebflux.server.EchoHandlerFunction -import io.opentelemetry.test.instrumentation.springwebflux.server.FooModel -import io.opentelemetry.test.instrumentation.springwebflux.server.SpringWebFluxTestApplication -import io.opentelemetry.test.instrumentation.springwebflux.server.TestController import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody @@ -16,6 +12,10 @@ import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory import org.springframework.boot.web.server.LocalServerPort import org.springframework.context.annotation.Bean import org.springframework.web.server.ResponseStatusException +import server.EchoHandlerFunction +import server.FooModel +import server.SpringWebFluxTestApplication +import server.TestController @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = [SpringWebFluxTestApplication, ForceNettyAutoConfiguration]) class SpringWebfluxTest extends AgentTestRunner { diff --git a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/client/SpringWebfluxHttpClientTest.groovy b/instrumentation/spring-webflux-5/src/test/groovy/client/SpringWebfluxHttpClientTest.groovy similarity index 98% rename from instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/client/SpringWebfluxHttpClientTest.groovy rename to instrumentation/spring-webflux-5/src/test/groovy/client/SpringWebfluxHttpClientTest.groovy index 40924e39a1..fafb944b0e 100644 --- a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/client/SpringWebfluxHttpClientTest.groovy +++ b/instrumentation/spring-webflux-5/src/test/groovy/client/SpringWebfluxHttpClientTest.groovy @@ -1,4 +1,4 @@ -package io.opentelemetry.test.instrumentation.springwebflux.client +package client import io.opentelemetry.auto.instrumentation.api.MoreTags import io.opentelemetry.auto.instrumentation.api.SpanTypes diff --git a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/EchoHandler.groovy b/instrumentation/spring-webflux-5/src/test/groovy/server/EchoHandler.groovy similarity index 76% rename from instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/EchoHandler.groovy rename to instrumentation/spring-webflux-5/src/test/groovy/server/EchoHandler.groovy index 0be1fbe01f..f8d77a15d3 100644 --- a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/EchoHandler.groovy +++ b/instrumentation/spring-webflux-5/src/test/groovy/server/EchoHandler.groovy @@ -1,4 +1,4 @@ -package io.opentelemetry.test.instrumentation.springwebflux.server +package server import io.opentelemetry.OpenTelemetry import io.opentelemetry.trace.Tracer @@ -8,10 +8,6 @@ import org.springframework.web.reactive.function.server.ServerRequest import org.springframework.web.reactive.function.server.ServerResponse import reactor.core.publisher.Mono -/** - * Note: this class has to stay outside of 'io.opentelemetry.auto.*' package because we need - * it transformed by {@code @Trace} annotation. - */ @Component class EchoHandler { diff --git a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/EchoHandlerFunction.groovy b/instrumentation/spring-webflux-5/src/test/groovy/server/EchoHandlerFunction.groovy similarity index 89% rename from instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/EchoHandlerFunction.groovy rename to instrumentation/spring-webflux-5/src/test/groovy/server/EchoHandlerFunction.groovy index eb0ddf3a33..a3a669115f 100644 --- a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/EchoHandlerFunction.groovy +++ b/instrumentation/spring-webflux-5/src/test/groovy/server/EchoHandlerFunction.groovy @@ -1,4 +1,4 @@ -package io.opentelemetry.test.instrumentation.springwebflux.server +package server import org.springframework.web.reactive.function.server.HandlerFunction diff --git a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/FooModel.groovy b/instrumentation/spring-webflux-5/src/test/groovy/server/FooModel.groovy similarity index 77% rename from instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/FooModel.groovy rename to instrumentation/spring-webflux-5/src/test/groovy/server/FooModel.groovy index 182ca5f00d..51a63099f7 100644 --- a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/FooModel.groovy +++ b/instrumentation/spring-webflux-5/src/test/groovy/server/FooModel.groovy @@ -1,4 +1,4 @@ -package io.opentelemetry.test.instrumentation.springwebflux.server +package server class FooModel { public long id diff --git a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/SpringWebFluxTestApplication.groovy b/instrumentation/spring-webflux-5/src/test/groovy/server/SpringWebFluxTestApplication.groovy similarity index 98% rename from instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/SpringWebFluxTestApplication.groovy rename to instrumentation/spring-webflux-5/src/test/groovy/server/SpringWebFluxTestApplication.groovy index 004974b066..cb5e773d6d 100644 --- a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/SpringWebFluxTestApplication.groovy +++ b/instrumentation/spring-webflux-5/src/test/groovy/server/SpringWebFluxTestApplication.groovy @@ -1,4 +1,4 @@ -package io.opentelemetry.test.instrumentation.springwebflux.server +package server import io.opentelemetry.OpenTelemetry import io.opentelemetry.trace.Tracer diff --git a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/TestController.groovy b/instrumentation/spring-webflux-5/src/test/groovy/server/TestController.groovy similarity index 96% rename from instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/TestController.groovy rename to instrumentation/spring-webflux-5/src/test/groovy/server/TestController.groovy index 129a657756..473c1b759a 100644 --- a/instrumentation/spring-webflux-5/src/test/groovy/dd/io/opentelemetry/test/instrumentation/springwebflux/server/TestController.groovy +++ b/instrumentation/spring-webflux-5/src/test/groovy/server/TestController.groovy @@ -1,4 +1,4 @@ -package io.opentelemetry.test.instrumentation.springwebflux.server +package server import io.opentelemetry.OpenTelemetry import io.opentelemetry.trace.Tracer diff --git a/instrumentation/spring-webflux-5/src/test/java/dd/io/opentelemetry/test/instrumentation/springwebflux/server/RedirectComponent.java b/instrumentation/spring-webflux-5/src/test/java/server/RedirectComponent.java similarity index 92% rename from instrumentation/spring-webflux-5/src/test/java/dd/io/opentelemetry/test/instrumentation/springwebflux/server/RedirectComponent.java rename to instrumentation/spring-webflux-5/src/test/java/server/RedirectComponent.java index 48b24d1550..9ff0590ef5 100644 --- a/instrumentation/spring-webflux-5/src/test/java/dd/io/opentelemetry/test/instrumentation/springwebflux/server/RedirectComponent.java +++ b/instrumentation/spring-webflux-5/src/test/java/server/RedirectComponent.java @@ -1,4 +1,4 @@ -package io.opentelemetry.test.instrumentation.springwebflux.server; +package server; import static org.springframework.web.reactive.function.server.RequestPredicates.GET; import static org.springframework.web.reactive.function.server.RouterFunctions.route; diff --git a/instrumentation/spymemcached-2.12/src/test/groovy/io/opentelemetry/auto/instrumentation/spymemcached/SpymemcachedTest.groovy b/instrumentation/spymemcached-2.12/src/test/groovy/SpymemcachedTest.groovy similarity index 98% rename from instrumentation/spymemcached-2.12/src/test/groovy/io/opentelemetry/auto/instrumentation/spymemcached/SpymemcachedTest.groovy rename to instrumentation/spymemcached-2.12/src/test/groovy/SpymemcachedTest.groovy index a7860e26c1..9885829b93 100644 --- a/instrumentation/spymemcached-2.12/src/test/groovy/io/opentelemetry/auto/instrumentation/spymemcached/SpymemcachedTest.groovy +++ b/instrumentation/spymemcached-2.12/src/test/groovy/SpymemcachedTest.groovy @@ -1,10 +1,9 @@ -package io.opentelemetry.auto.instrumentation.spymemcached - import com.google.common.util.concurrent.MoreExecutors import io.opentelemetry.auto.config.Config import io.opentelemetry.auto.instrumentation.api.MoreTags import io.opentelemetry.auto.instrumentation.api.SpanTypes import io.opentelemetry.auto.instrumentation.api.Tags +import io.opentelemetry.auto.instrumentation.spymemcached.CompletionListener import io.opentelemetry.auto.test.AgentTestRunner import io.opentelemetry.auto.test.asserts.TraceAssert import net.spy.memcached.CASResponse @@ -25,9 +24,6 @@ import java.util.concurrent.BlockingQueue import java.util.concurrent.ExecutorService import java.util.concurrent.locks.ReentrantLock -import static CompletionListener.COMPONENT_NAME -import static CompletionListener.OPERATION_NAME -import static CompletionListener.SERVICE_NAME import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace import static net.spy.memcached.ConnectionFactoryBuilder.Protocol.BINARY @@ -630,14 +626,14 @@ class SpymemcachedTest extends AgentTestRunner { childOf(trace.span(0)) } - operationName OPERATION_NAME + operationName CompletionListener.OPERATION_NAME errored(error != null && error != "canceled") tags { - "$MoreTags.SERVICE_NAME" SERVICE_NAME + "$MoreTags.SERVICE_NAME" CompletionListener.SERVICE_NAME "$MoreTags.RESOURCE_NAME" operation "$MoreTags.SPAN_TYPE" SpanTypes.MEMCACHED - "$Tags.COMPONENT" COMPONENT_NAME + "$Tags.COMPONENT" CompletionListener.COMPONENT_NAME "$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT "$Tags.DB_TYPE" CompletionListener.DB_TYPE diff --git a/instrumentation/trace-annotation/src/test/java/dd/test/io/opentelemetry/test/annotation/SayTracedHello.java b/instrumentation/trace-annotation/src/test/java/test/io/opentelemetry/test/annotation/SayTracedHello.java similarity index 100% rename from instrumentation/trace-annotation/src/test/java/dd/test/io/opentelemetry/test/annotation/SayTracedHello.java rename to instrumentation/trace-annotation/src/test/java/test/io/opentelemetry/test/annotation/SayTracedHello.java