diff --git a/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationIntegrationTests.java b/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationIntegrationTests.java index 28d196efd2..a6c1e90ef2 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationIntegrationTests.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationIntegrationTests.java @@ -159,8 +159,6 @@ public static class Listener { final CountDownLatch latch1 = new CountDownLatch(1); - volatile ConsumerRecord record; - public Listener(KafkaTemplate template) { this.template = template; } @@ -172,11 +170,9 @@ void listen1(ConsumerRecord in) { @KafkaListener(id = "obs2", topics = "int.observation.testT2") void listen2(ConsumerRecord in) { - this.record = in; this.latch1.countDown(); } } - }