hachikuji commented on a change in pull request #8822: URL: https://github.com/apache/kafka/pull/8822#discussion_r436391255
########## File path: clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java ########## @@ -3856,12 +3857,16 @@ private void testOffsetValidationWithGivenEpochOffset(final EpochEndOffset epoch assertEquals(initialOffset, subscriptions.position(tp0).offset); if (offsetResetStrategy == OffsetResetStrategy.NONE) { - OffsetOutOfRangeException thrown = - assertThrows(OffsetOutOfRangeException.class, () -> fetcher.validateOffsetsIfNeeded()); + LogTruncationException thrown = + assertThrows(LogTruncationException.class, () -> fetcher.validateOffsetsIfNeeded()); + assertEquals(initialOffset, thrown.offsetOutOfRangePartitions().get(tp0).longValue()); - // If epoch offset is valid, we are testing for the log truncation case. - if (!epochEndOffset.hasUndefinedEpochOrOffset()) { - assertTrue(thrown instanceof LogTruncationException); + if (epochEndOffset.hasUndefinedEpochOrOffset()) { + assertFalse(thrown.divergentOffsets().containsKey(tp0)); Review comment: I did assertEquals with an empty map. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org