jsancio commented on code in PR #15671: URL: https://github.com/apache/kafka/pull/15671#discussion_r1581315479
########## clients/src/test/java/org/apache/kafka/common/record/ControlRecordTypeTest.java: ########## @@ -45,4 +45,58 @@ public void testParseUnknownVersion() { assertEquals(ControlRecordType.ABORT, type); } + @Test + public void testLeaderChange() { + ByteBuffer buffer = ByteBuffer.allocate(32); + buffer.putShort(ControlRecordType.CURRENT_CONTROL_RECORD_KEY_VERSION); + buffer.putShort((short) 2); + buffer.flip(); + + ControlRecordType type = ControlRecordType.parse(buffer); + assertEquals(ControlRecordType.LEADER_CHANGE, type); + } + + @Test + public void testSnapshotHeader() { + ByteBuffer buffer = ByteBuffer.allocate(32); + buffer.putShort(ControlRecordType.CURRENT_CONTROL_RECORD_KEY_VERSION); + buffer.putShort((short) 3); + buffer.flip(); + + ControlRecordType type = ControlRecordType.parse(buffer); + assertEquals(ControlRecordType.SNAPSHOT_HEADER, type); + } + + @Test + public void testSnapshotFooter() { Review Comment: Fixed. -- 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