mimaison commented on code in PR #15516:
URL: https://github.com/apache/kafka/pull/15516#discussion_r1598619060
##########
clients/src/test/java/org/apache/kafka/common/record/DefaultRecordBatchTest.java:
##########
@@ -500,27 +501,24 @@ private static Stream<Arguments>
testBufferReuseInSkipKeyValueIterator() {
@MethodSource
public void testZstdJniForSkipKeyValueIterator(int expectedJniCalls,
byte[] recordValue) throws IOException {
MemoryRecords records =
MemoryRecords.withRecords(RecordBatch.MAGIC_VALUE_V2, 0L,
- CompressionType.ZSTD, TimestampType.CREATE_TIME,
+ Compression.zstd().build(), TimestampType.CREATE_TIME,
new SimpleRecord(9L, "hakuna-matata".getBytes(), recordValue)
);
// Buffer containing compressed data
final ByteBuffer compressedBuf = records.buffer();
// Create a RecordBatch object
final DefaultRecordBatch batch = spy(new
DefaultRecordBatch(compressedBuf.duplicate()));
- final CompressionType mockCompression =
mock(CompressionType.ZSTD.getClass());
- doReturn(mockCompression).when(batch).compressionType();
-
+ final ZstdCompression compression = Compression.zstd().build();
// Buffer containing compressed records to be used for creating
zstd-jni stream
- ByteBuffer recordsBuffer = compressedBuf.duplicate();
+ ByteBuffer recordsBuffer = spy(compressedBuf.duplicate());
Review Comment:
Right, it's not needed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]