lucasbru commented on code in PR #14503: URL: https://github.com/apache/kafka/pull/14503#discussion_r1357057172
########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/PrototypeAsyncConsumerTest.java: ########## @@ -322,6 +323,25 @@ public void testOffsetsForTimesOnNullPartitions() { Duration.ofMillis(1))); } + @Test + public void testOffsetsForTimesFailsOnNegativeTargetTimes() { + PrototypeAsyncConsumer<?, ?> consumer = newConsumer(time, new StringDeserializer(), new StringDeserializer()); + assertThrows(IllegalArgumentException.class, + () -> consumer.offsetsForTimes(Collections.singletonMap(new TopicPartition( + "topic1", 1), ListOffsetsRequest.EARLIEST_TIMESTAMP), + Duration.ofMillis(1))); + + assertThrows(IllegalArgumentException.class, + () -> consumer.offsetsForTimes(Collections.singletonMap(new TopicPartition( Review Comment: Consistency with the old consumer, say no more! -- 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