Fix spring-kafka latest dep tests
@@ -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")
+ }
+ })
+ }
+ }
}
