Fix spring-kafka latest dep tests
MODIFY
instrumentation/spring/spring-kafka-2.7/javaagent/src/test/groovy/SpringKafkaInstrumentationTest.groovy
instrumentation/spring/spring-kafka-2.7/javaagent/src/test/groovy/SpringKafkaInstrumentationTest.groovy
@@ -215,14 +215,9 @@ class SpringKafkaInstrumentationTest extends AgentInstrumentationSpecification {
.build()
}
- @KafkaListener(id = "testListener", topics = "testTopic", containerFactory = "batchFactory")
- void listener(List<ConsumerRecord<String, String>> records) {
- runInternalSpan("consumer")
- records.forEach({ record ->
- if (record.value() == "error") {
- throw new IllegalArgumentException("boom")
- }
- })
+ @Bean
+ Listener listener() {
+ return new Listener()
}
@Bean
@@ -241,4 +236,17 @@ class SpringKafkaInstrumentationTest extends AgentInstrumentationSpecification {
factory
}
}
+
+ static class Listener {
+
+ @KafkaListener(id = "testListener", topics = "testTopic", containerFactory = "batchFactory")
+ void listener(List<ConsumerRecord<String, String>> records) {
+ runInternalSpan("consumer")
+ records.forEach({ record ->
+ if (record.value() == "error") {
+ throw new IllegalArgumentException("boom")
+ }
+ })
+ }
+ }
}

Fix spring-kafka latest dep tests (#4676)