Skip to content

Commit d8747db

Browse files
Code cleanup.
1 parent 5743cd5 commit d8747db

File tree

16 files changed

+40
-30
lines changed

16 files changed

+40
-30
lines changed

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ testing {
8080
suites {
8181
val test by getting(JvmTestSuite::class) {
8282
dependencies {
83-
implementation(libs.spock.core)
8483
implementation(libs.groovy)
84+
implementation(libs.spock.core)
8585
}
8686
targets.configureEach {
8787
testTask.configure {

buildSrc/call-site-instrumentation-plugin/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ dependencies {
3535
implementation("com.github.javaparser", "javaparser-symbol-solver-core", "3.24.4")
3636

3737
testImplementation(libs.bytebuddy)
38-
testImplementation(libs.spock.core)
39-
testImplementation("org.objenesis", "objenesis", "3.0.1")
4038
testImplementation(libs.groovy)
39+
testImplementation(libs.bundles.spock)
4140
testImplementation("javax.servlet", "javax.servlet-api", "3.0.1")
4241
testImplementation("com.github.spotbugs", "spotbugs-annotations", "4.2.0")
4342
}

communication/src/test/groovy/datadog/communication/http/RejectingExecutorServiceTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
package datadog.communication.http
22

3+
import static org.junit.jupiter.api.Assertions.assertThrows
4+
35
import org.junit.jupiter.api.Test
46

57
import java.util.concurrent.ExecutorService
68
import java.util.concurrent.RejectedExecutionException
79
import java.util.concurrent.TimeUnit
810

9-
import static groovy.test.GroovyAssert.shouldFail
10-
1111
class RejectingExecutorServiceTest {
1212
ExecutorService executorService = new RejectingExecutorService()
1313

1414
@Test
1515
void 'execute throws exception'() {
16-
shouldFail(RejectedExecutionException) {
16+
assertThrows(RejectedExecutionException) {
1717
executorService.execute({})
1818
}
1919
}

dd-java-agent/agent-iast/iast-test-fixtures/src/main/groovy/com/datadog/iast/test/NoopOverheadController.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package com.datadog.iast.test
33
import com.datadog.iast.model.VulnerabilityType
44
import com.datadog.iast.overhead.Operation
55
import com.datadog.iast.overhead.OverheadController
6-
import com.github.javaparser.quality.Nullable
76
import datadog.trace.bootstrap.instrumentation.api.AgentSpan
87
import groovy.transform.CompileStatic
8+
import javax.annotation.Nullable
99

1010
@CompileStatic
1111
class NoopOverheadController implements OverheadController {

dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/InstrumentationSpecification.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ abstract class InstrumentationSpecification extends DDSpecification implements A
515515
def sw = new StringWriter()
516516
PrintWriter pw = new PrintWriter(sw)
517517
entry.value.eachWithIndex { Exception e, int i ->
518-
pw.write('\n' as char)
518+
pw.write((char)'\n')
519519
pw.write "Location $i:\n"
520520
def st = e.stackTrace
521521
int loc = st.findIndexOf {

dd-java-agent/instrumentation-testing/src/test/groovy/server/HttpServerTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ class HttpServerTest extends InstrumentationSpecification {
435435
436436
then:
437437
clientResponse.code() == 500
438-
IOUtils.readFully (clientResponse.body().byteStream()).contains("assert body != null")
438+
IOUtils.readFully(clientResponse.body().byteStream()).contains("assert body != null")
439439
440440
cleanup:
441441
server.stop()

dd-java-agent/instrumentation/jax-rs-annotations-1/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ apply from: "$rootDir/gradle/java.gradle"
1616
dependencies {
1717
compileOnly group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'
1818

19-
testImplementation libs.spock.junit4 // This legacy module still needs JUnit4.
19+
testImplementation libs.junit4 // This legacy still needs JUnit4.
2020
testImplementation group: 'io.dropwizard', name: 'dropwizard-testing', version: '0.7.1'
2121
testImplementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.3'
2222
}

dd-java-agent/instrumentation/junit/junit-5.3/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ dependencies {
3636

3737
testImplementation project(':dd-java-agent:agent-ci-visibility:civisibility-instrumentation-test-fixtures')
3838

39+
testImplementation libs.junit4 // This module still needs JUnit4.
40+
3941
// versions used below are not the minimum ones that we support,
4042
// but the tests need to use them in order to be compliant with Spock 2.x
4143
testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: libs.versions.junit.platform.get()

dd-java-agent/instrumentation/junit/junit-5.3/src/test/java/org/example/TestAssumptionLegacy.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class TestAssumptionLegacy {
77

88
@Test
99
public void test_fail_assumption_legacy() {
10+
// Throw exception from legacy JUnit4 library.
1011
throw new AssumptionViolatedException("assumption is not fulfilled");
1112
}
1213
}

dd-java-agent/instrumentation/kafka/kafka-clients-0.11/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
compileOnly group: 'org.apache.kafka', name: 'kafka-clients', version: '0.11.0.0'
2727
implementation project(':dd-java-agent:instrumentation:kafka:kafka-common')
2828

29-
testImplementation libs.spock.junit4 // This legacy module still needs JUnit4.
29+
testImplementation libs.junit4 // This module still needs JUnit4.
3030
testImplementation group: 'org.apache.kafka', name: 'kafka-clients', version: '0.11.0.0'
3131
testImplementation group: 'org.springframework.kafka', name: 'spring-kafka', version: '1.3.3.RELEASE'
3232
testImplementation group: 'org.springframework.kafka', name: 'spring-kafka-test', version: '1.3.3.RELEASE'

0 commit comments

Comments
 (0)