Apply formatter on groovy files.
MODIFY
dd-java-agent-ittests/src/test/groovy/datadog/trace/agent/integration/muzzle/MuzzleBytecodeTransformTest.groovy
dd-java-agent-ittests/src/test/groovy/datadog/trace/agent/integration/muzzle/MuzzleBytecodeTransformTest.groovy
package datadog.trace.agent.integration.muzzle
import datadog.trace.agent.test.IntegrationTestUtils
-import java.lang.reflect.Field
-import java.lang.reflect.Method
import spock.lang.Specification
+import java.lang.reflect.Field
+import java.lang.reflect.Method
class MuzzleBytecodeTransformTest extends Specification {

MODIFY
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/ClassLoaderMatcherTest.groovy
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/ClassLoaderMatcherTest.groovy
package datadog.trace.agent.test
-import datadog.trace.bootstrap.DatadogClassLoader
import datadog.trace.agent.tooling.ClassLoaderMatcher
+import datadog.trace.bootstrap.DatadogClassLoader
import spock.lang.Specification
-
class ClassLoaderMatcherTest extends Specification {
def "skip non-delegating classloader"() {
@@ -37,6 +36,7 @@ class ClassLoaderMatcherTest extends Specification {
/*
* A URLClassloader which only delegates java.* classes
*/
+
private static class NonDelegatingClassLoader extends URLClassLoader {
NonDelegatingClassLoader() {
super(new URL[0], (ClassLoader) null)

MODIFY
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/ExceptionHandlerTest.groovy
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/ExceptionHandlerTest.groovy
package datadog.trace.agent.test
-import datadog.trace.bootstrap.ExceptionLogger
+import ch.qos.logback.classic.Level
+import ch.qos.logback.classic.Logger
+import ch.qos.logback.core.read.ListAppender
import datadog.trace.agent.tooling.ExceptionHandlers
+import datadog.trace.bootstrap.ExceptionLogger
import net.bytebuddy.agent.ByteBuddyAgent
+import net.bytebuddy.agent.builder.AgentBuilder
import net.bytebuddy.dynamic.ClassFileLocator
+import org.slf4j.LoggerFactory
+import spock.lang.Shared
+import spock.lang.Specification
import static net.bytebuddy.matcher.ElementMatchers.isMethod
import static net.bytebuddy.matcher.ElementMatchers.named
-import net.bytebuddy.agent.builder.AgentBuilder
-import spock.lang.Specification
-import spock.lang.Shared
-
-import org.slf4j.LoggerFactory
-import ch.qos.logback.classic.Logger
-import ch.qos.logback.core.read.ListAppender
-import ch.qos.logback.classic.Level
-
class ExceptionHandlerTest extends Specification {
@Shared
ListAppender testAppender = new ListAppender()

MODIFY
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/HelperInjectionTest.groovy
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/HelperInjectionTest.groovy
package datadog.trace.agent.test
import datadog.trace.agent.tooling.AgentInstaller
-
-import static datadog.trace.agent.tooling.ClassLoaderMatcher.BOOTSTRAP_CLASSLOADER
-
import datadog.trace.agent.tooling.HelperInjector
import datadog.trace.agent.tooling.Utils
import net.bytebuddy.agent.ByteBuddyAgent
@@ -11,6 +8,8 @@ import spock.lang.Specification
import java.lang.reflect.Method
+import static datadog.trace.agent.tooling.ClassLoaderMatcher.BOOTSTRAP_CLASSLOADER
+
class HelperInjectionTest extends Specification {
def "helpers injected to non-delegating classloader"() {

MODIFY
dd-java-agent/instrumentation/akka-http-10.0/src/lagomTest/groovy/LagomTest.groovy
dd-java-agent/instrumentation/akka-http-10.0/src/lagomTest/groovy/LagomTest.groovy
import akka.NotUsed
import akka.stream.javadsl.Source
+import akka.stream.testkit.TestSubscriber.Probe
import akka.stream.testkit.javadsl.TestSink
+import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.api.DDSpanTypes
import datadog.trace.api.DDTags
import io.opentracing.tag.Tags
import net.bytebuddy.utility.JavaModule
-
-import datadog.trace.agent.test.AgentTestRunner
import play.inject.guice.GuiceApplicationBuilder
import spock.lang.Shared
-import akka.stream.testkit.TestSubscriber.Probe
-
import java.util.function.Function
-import static com.lightbend.lagom.javadsl.testkit.ServiceTest.*
+import static com.lightbend.lagom.javadsl.testkit.ServiceTest.TestServer
+import static com.lightbend.lagom.javadsl.testkit.ServiceTest.defaultSetup
+import static com.lightbend.lagom.javadsl.testkit.ServiceTest.startServer
import static datadog.trace.agent.test.ListWriterAssert.assertTraces
class LagomTest extends AgentTestRunner {
@@ -51,7 +51,8 @@ class LagomTest extends AgentTestRunner {
GuiceApplicationBuilder apply(GuiceApplicationBuilder builder) {
return builder
.bindings(new ServiceTestModule())
- }}))
+ }
+ }))
}
def cleanupSpec() {

MODIFY
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy
@@ -4,7 +4,9 @@ import datadog.trace.agent.test.OkHttpUtils
import datadog.trace.agent.test.TestUtils
import datadog.trace.api.DDSpanTypes
import io.netty.handler.codec.http.HttpResponseStatus
-import okhttp3.*
+import okhttp3.OkHttpClient
+import okhttp3.Request
+import okhttp3.Response
import org.apache.catalina.Context
import org.apache.catalina.startup.Tomcat
import org.apache.jasper.JasperException

MODIFY
dd-java-agent/instrumentation/lettuce-5/src/test/groovy/LettuceAsyncClientTest.groovy
dd-java-agent/instrumentation/lettuce-5/src/test/groovy/LettuceAsyncClientTest.groovy
@@ -466,7 +466,8 @@ class LettuceAsyncClientTest extends AgentTestRunner {
def conds = new AsyncConditions()
RedisFuture redisFuture = asyncCommands.sadd("SKEY", "1", "2")
redisFuture.whenCompleteAsync({
- res, throwable -> conds.evaluate {
+ res, throwable ->
+ conds.evaluate {
assert throwable != null
assert throwable instanceof CancellationException
}

MODIFY
dd-java-agent/instrumentation/lettuce-5/src/test/groovy/LettuceReactiveClientTest.groovy
dd-java-agent/instrumentation/lettuce-5/src/test/groovy/LettuceReactiveClientTest.groovy
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.TestUtils
-import io.lettuce.core.*
+import io.lettuce.core.ClientOptions
+import io.lettuce.core.RedisClient
import io.lettuce.core.api.StatefulConnection
import io.lettuce.core.api.reactive.RedisReactiveCommands
import io.lettuce.core.api.sync.RedisCommands
@@ -143,7 +144,8 @@ class LettuceReactiveClientTest extends AgentTestRunner {
when:
reactiveCommands.get("NON_EXISTENT_KEY").defaultIfEmpty(defaultVal).subscribe {
- res -> conds.evaluate {
+ res ->
+ conds.evaluate {
assert res == defaultVal
}
}
@@ -178,7 +180,8 @@ class LettuceReactiveClientTest extends AgentTestRunner {
when:
reactiveCommands.randomkey().subscribe {
- res -> conds.evaluate {
+ res ->
+ conds.evaluate {
assert res == "TESTKEY"
}
}

MODIFY
dd-java-agent/instrumentation/spymemcached-2.12/src/test/groovy/datadog/trace/instrumentation/spymemcached/SpymemcachedTest.groovy
dd-java-agent/instrumentation/spymemcached-2.12/src/test/groovy/datadog/trace/instrumentation/spymemcached/SpymemcachedTest.groovy
@@ -22,11 +22,11 @@ import java.util.concurrent.BlockingQueue
import java.util.concurrent.ExecutorService
import java.util.concurrent.locks.ReentrantLock
-import static datadog.trace.agent.test.ListWriterAssert.assertTraces
import static CompletionListener.COMPONENT_NAME
import static CompletionListener.OPERATION_NAME
import static CompletionListener.SERVICE_NAME
import static CompletionListener.SPAN_TYPE
+import static datadog.trace.agent.test.ListWriterAssert.assertTraces
import static datadog.trace.agent.test.TestUtils.runUnderTrace
import static net.spy.memcached.ConnectionFactoryBuilder.Protocol.BINARY

MODIFY
dd-java-agent/testing/src/test/groovy/AgentTestRunnerTest.groovy
dd-java-agent/testing/src/test/groovy/AgentTestRunnerTest.groovy
+import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.TestUtils
import io.opentracing.Tracer
import java.lang.reflect.Field
-import datadog.trace.agent.test.AgentTestRunner
-
class AgentTestRunnerTest extends AgentTestRunner {
private static final ClassLoader BOOTSTRAP_CLASSLOADER = null
private static final ClassLoader OT_LOADER

MODIFY
dd-java-agent/testing/src/test/groovy/muzzle/AdviceReferenceVisitorTest.groovy
dd-java-agent/testing/src/test/groovy/muzzle/AdviceReferenceVisitorTest.groovy
@@ -2,9 +2,9 @@ package muzzle
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.TestUtils
+import datadog.trace.agent.tooling.muzzle.Reference
import datadog.trace.agent.tooling.muzzle.ReferenceCreator
import datadog.trace.agent.tooling.muzzle.ReferenceMatcher
-import datadog.trace.agent.tooling.muzzle.Reference
class AdviceReferenceVisitorTest extends AgentTestRunner {

Apply formatter on groovy files.