diff --git a/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationTests.java b/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationTests.java index 1add6ab14d..c8cd57d9dc 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationTests.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationTests.java @@ -90,14 +90,12 @@ */ @SpringJUnitConfig @EmbeddedKafka(topics = { "observation.testT1", "observation.testT2", "observation.testT3", - ObservationTests.OBSERVATION_RUNTIME_EXCEPTION, ObservationTests.OBSERVATION_ERROR}) + ObservationTests.OBSERVATION_RUNTIME_EXCEPTION}) @DirtiesContext public class ObservationTests { public final static String OBSERVATION_RUNTIME_EXCEPTION = "observation.runtime-exception"; - public final static String OBSERVATION_ERROR = "observation.error"; - @Test void endToEnd(@Autowired Listener listener, @Autowired KafkaTemplate template, @Autowired SimpleTracer tracer, @Autowired KafkaListenerEndpointRegistry rler, @@ -256,27 +254,6 @@ void observationRuntimeException(@Autowired ExceptionListener listener, @Autowir .hasMessage("obs4 run time exception"); } - @Test - void observationErrorException(@Autowired ExceptionListener listener, @Autowired SimpleTracer tracer, - @Autowired @Qualifier("throwableTemplate") KafkaTemplate errorTemplate, - @Autowired KafkaListenerEndpointRegistry endpointRegistry) - throws ExecutionException, InterruptedException, TimeoutException { - - errorTemplate.send(OBSERVATION_ERROR, "testError").get(10, TimeUnit.SECONDS); - assertThat(listener.latch5.await(10, TimeUnit.SECONDS)).isTrue(); - endpointRegistry.getListenerContainer("obs5").stop(); - - Deque spans = tracer.getSpans(); - assertThat(spans).hasSize(2); - SimpleSpan span = spans.poll(); - assertThat(span.getTags().get("spring.kafka.template.name")).isEqualTo("throwableTemplate"); - span = spans.poll(); - assertThat(span.getTags().get("spring.kafka.listener.id")).isEqualTo("obs5-0"); - assertThat(span.getError()) - .isInstanceOf(Error.class) - .hasMessage("obs5 error"); - } - @Configuration @EnableKafka public static class Config { @@ -457,12 +434,6 @@ void listenRuntimeException(ConsumerRecord in) { throw new IllegalStateException("obs4 run time exception"); } - @KafkaListener(id = "obs5", topics = OBSERVATION_ERROR) - void listenError(ConsumerRecord in) { - this.latch5.countDown(); - throw new Error("obs5 error"); - } - } }