rewrite-spring icon indicating copy to clipboard operation
rewrite-spring copied to clipboard

Switch KafkaTestUtils timeout arguments from long to Duration

Open timtebeek opened this issue 2 years ago • 0 comments

KafkaTestUtils from spring-kafka provides a number of static helper methods to consume records, retrieve various record offsets, and others. Recently a number of methods switched from taking a long timeout to a Duration timeout.

-org.springframework.kafka.test.utils.KafkaTestUtils#getRecords(org.apache.kafka.clients.consumer.Consumer<K,V> consumer, long timeout)
+org.springframework.kafka.test.utils.KafkaTestUtils#getRecords(org.apache.kafka.clients.consumer.Consumer<K,V> consumer, Duration timeout)

A recipe could help migrate users of the old method argument to the new method argument type. These changes were first introduced in 2.9.3, which is also the last version to contain both methods.

timtebeek avatar Jan 22 '23 21:01 timtebeek