frankvicky commented on code in PR #19516:
URL: https://github.com/apache/kafka/pull/19516#discussion_r2051494839


##########
clients/src/test/java/org/apache/kafka/common/utils/annotation/ApiKeyVersionsProvider.java:
##########
@@ -23,16 +23,36 @@
 import org.junit.jupiter.params.provider.ArgumentsProvider;
 import org.junit.jupiter.params.support.AnnotationConsumer;
 
+import java.util.stream.IntStream;
 import java.util.stream.Stream;
 
 public class ApiKeyVersionsProvider implements ArgumentsProvider, 
AnnotationConsumer<ApiKeyVersionsSource> {
     private ApiKeys apiKey;
+    private short fromVersion;
+    private short toVersion;
 
     public void accept(ApiKeyVersionsSource source) {
         apiKey = source.apiKey();
+        fromVersion = source.fromVersion() == -1 ? apiKey.oldestVersion() : 
source.fromVersion();
+        toVersion = source.toVersion() == -1 ? 
apiKey.latestVersion(source.enableUnstableLastVersion()) : source.toVersion();

Review Comment:
   nit: Could we extract 
`apiKey.latestVersion(source.enableUnstableLastVersion())` as a variable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to