g1geordie commented on a change in pull request #9906: URL: https://github.com/apache/kafka/pull/9906#discussion_r562502128
########## File path: clients/src/test/java/org/apache/kafka/common/record/MemoryRecordsBuilderTest.java ########## @@ -66,25 +65,38 @@ public String toString() { } } + private static Stream<Arguments> allArguments(Predicate<CompressionType> accept) { + List<Arguments> values = new ArrayList<>(); + for (int bufferOffset : Arrays.asList(0, 15)) + for (CompressionType compressionType : CompressionType.values()) + if (accept.test(compressionType)) + values.add(Arguments.of(new Args(bufferOffset, compressionType))); + return values.stream(); + } + private static class MemoryRecordsBuilderArgumentsProvider implements ArgumentsProvider { @Override public Stream<? extends Arguments> provideArguments(ExtensionContext context) { - List<Arguments> values = new ArrayList<>(); - for (int bufferOffset : Arrays.asList(0, 15)) - for (CompressionType compressionType : CompressionType.values()) - values.add(Arguments.of(new Args(bufferOffset, compressionType))); - return values.stream(); + return allArguments(type -> true); + } + } + + /** + * CompressionType.ZSTD only support when magic >= RecordBatch.MAGIC_VALUE_V2 + */ Review comment: @chia7712 Is it the comment that you want to add? ---------------------------------------------------------------- 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