Skip to content

Commit 26a240c

Browse files
committed
Update spring-kafka latestDep tests for 4.0
1 parent 9ea03e9 commit 26a240c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

instrumentation/spring/spring-kafka-2.7/javaagent/build.gradle.kts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ muzzle {
1111
}
1212
}
1313

14+
val latestDepTest = findProperty("testLatestDeps") as Boolean
15+
1416
dependencies {
1517
compileOnly("com.google.auto.value:auto-value-annotations")
1618
annotationProcessor("com.google.auto.value:auto-value")
@@ -20,7 +22,11 @@ dependencies {
2022
implementation(project(":instrumentation:kafka:kafka-clients:kafka-clients-common-0.11:library"))
2123
implementation(project(":instrumentation:spring:spring-kafka-2.7:library"))
2224

23-
library("org.springframework.kafka:spring-kafka:2.7.0")
25+
if (latestDepTest) {
26+
library("org.springframework.boot:spring-boot-starter-kafka:4.0.0")
27+
} else {
28+
library("org.springframework.kafka:spring-kafka:2.7.0")
29+
}
2430

2531
testInstrumentation(project(":instrumentation:kafka:kafka-clients:kafka-clients-0.11:javaagent"))
2632
testInstrumentation(project(":instrumentation:spring:spring-scheduling-3.1:javaagent"))
@@ -29,13 +35,8 @@ dependencies {
2935

3036
testLibrary("org.springframework.boot:spring-boot-starter-test:2.5.3")
3137
testLibrary("org.springframework.boot:spring-boot-starter:2.5.3")
32-
33-
// tests don't work with spring boot 4 yet
34-
latestDepTestLibrary("org.springframework.boot:spring-boot-starter-test:3.+") // documented limitation
35-
latestDepTestLibrary("org.springframework.boot:spring-boot-starter:3.+") // documented limitation
3638
}
3739

38-
val latestDepTest = findProperty("testLatestDeps") as Boolean
3940
val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false"
4041

4142
testing {
@@ -45,9 +46,9 @@ testing {
4546
implementation(project(":instrumentation:spring:spring-kafka-2.7:testing"))
4647

4748
// the "library" configuration is not recognized by the test suite plugin
48-
val springKafkaVersion = if (latestDepTest) "latest.release" else "2.7.0"
49-
val springBootVersion = if (latestDepTest) "3.+" else "2.5.3"
50-
implementation("org.springframework.kafka:spring-kafka:$springKafkaVersion")
49+
val springKafkaVersion = if (latestDepTest) "org.springframework.boot:spring-boot-starter-kafka:latest.release" else "org.springframework.kafka:spring-kafka:2.7.0"
50+
val springBootVersion = if (latestDepTest) "latest.release" else "2.5.3"
51+
implementation(springKafkaVersion)
5152
implementation("org.springframework.boot:spring-boot-starter-test:$springBootVersion")
5253
implementation("org.springframework.boot:spring-boot-starter:$springBootVersion")
5354
}

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ignore/AdditionalLibraryIgnoredTypesConfigurer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ public void configure(IgnoredTypesBuilder builder) {
112112
.allowClass(
113113
"org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter$$Lambda")
114114
.allowClass("org.springframework.boot.autoconfigure.BackgroundPreinitializer$")
115+
.allowClass(
116+
"org.springframework.boot.autoconfigure.preinitialize.BackgroundPreinitializingApplicationListener$")
115117
.allowClass(
116118
"org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration$$Lambda")
117119
.allowClass("org.springframework.boot.autoconfigure.condition.OnClassCondition$")

0 commit comments

Comments
 (0)