Browse Source

MINOR: Fix version range check in MessageTest (#7663)

This patch fixes the test utility `testAllMessageRoundTripsFromVersion` in `MessageTest` which was unintentionally excluding the highest version.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
pull/7609/merge
Jason Gustafson 5 years ago committed by GitHub
parent
commit
929c25732f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      clients/src/test/java/org/apache/kafka/common/message/MessageTest.java

3
clients/src/test/java/org/apache/kafka/common/message/MessageTest.java

@ -331,7 +331,6 @@ public final class MessageTest {
if (version < 6) { if (version < 6) {
requestData.topics().get(0).partitions().get(0).setCommittedLeaderEpoch(-1); requestData.topics().get(0).partitions().get(0).setCommittedLeaderEpoch(-1);
} }
if (version < 7) { if (version < 7) {
@ -598,7 +597,7 @@ public final class MessageTest {
} }
private void testAllMessageRoundTripsFromVersion(short fromVersion, Message message) throws Exception { private void testAllMessageRoundTripsFromVersion(short fromVersion, Message message) throws Exception {
for (short version = fromVersion; version < message.highestSupportedVersion(); version++) { for (short version = fromVersion; version <= message.highestSupportedVersion(); version++) {
testEquivalentMessageRoundTrip(version, message); testEquivalentMessageRoundTrip(version, message);
} }
} }

Loading…
Cancel
Save