Fix spring-kafka latest dep tests (#4676)

This commit is contained in:
Trask Stalnaker 2021-11-19 13:12:18 -08:00 committed by GitHub
parent 63e9cfa257
commit 6c98ba6b2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 8 deletions

View File

@ -215,14 +215,9 @@ class SpringKafkaInstrumentationTest extends AgentInstrumentationSpecification {
.build() .build()
} }
@KafkaListener(id = "testListener", topics = "testTopic", containerFactory = "batchFactory") @Bean
void listener(List<ConsumerRecord<String, String>> records) { Listener listener() {
runInternalSpan("consumer") return new Listener()
records.forEach({ record ->
if (record.value() == "error") {
throw new IllegalArgumentException("boom")
}
})
} }
@Bean @Bean
@ -241,4 +236,17 @@ class SpringKafkaInstrumentationTest extends AgentInstrumentationSpecification {
factory 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")
}
})
}
}
} }