apoorvmittal10 commented on code in PR #16456: URL: https://github.com/apache/kafka/pull/16456#discussion_r1672112684
########## core/src/test/scala/unit/kafka/server/KafkaApisTest.scala: ########## @@ -4390,6 +4401,2215 @@ class KafkaApisTest extends Logging { assertEquals("broker2", node.host) } + private def expectedAcquiredRecords(firstOffset : Long, lastOffset : Long, deliveryCount : Int) : util.List[AcquiredRecords] = { + val acquiredRecordsList : util.List[AcquiredRecords] = new util.ArrayList() + acquiredRecordsList.add(new AcquiredRecords() + .setFirstOffset(firstOffset) + .setLastOffset(lastOffset) + .setDeliveryCount(deliveryCount.toShort)) + acquiredRecordsList + } + + private def memoryRecordsBuilder(numOfRecords : Int, startOffset : Long) : MemoryRecordsBuilder = { + + val buffer: ByteBuffer = ByteBuffer.allocate(1024) + val compression: Compression = Compression.of(CompressionType.NONE).build() + val timestampType: TimestampType = TimestampType.CREATE_TIME + + val builder: MemoryRecordsBuilder = MemoryRecords.builder(buffer, compression, timestampType, startOffset) + for (i <- 0 until numOfRecords) { + builder.appendWithOffset(startOffset + i, 0L, TestUtils.randomBytes(10), TestUtils.randomBytes(10)) + } + builder + } Review Comment: So why not to have either in java or scala test utils which can be used by both? -- 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