squah-confluent commented on code in PR #24069:
URL: https://github.com/apache/kafka/pull/24069#discussion_r4455916966
##########
clients/src/test/java/org/apache/kafka/common/protocol/ByteBufferAccessorTest.java:
##########
@@ -40,6 +40,12 @@ public void testReadArray() {
assertEquals("Error reading byte array of 3 byte(s): only 0 byte(s)
available",
assertThrows(RuntimeException.class,
() -> accessor.readArray(3)).getMessage());
+ assertEquals("Error reading byte array of -1 byte(s): only 0 byte(s)
available",
+ assertThrows(RuntimeException.class,
+ () -> accessor.readArray(-1)).getMessage());
+ assertEquals("Error reading byte buffer of -1 byte(s): length cannot
be negative",
+ assertThrows(RuntimeException.class,
+ () -> accessor.readByteBuffer(-1)).getMessage());
Review Comment:
This belongs in a separate `testReadByteBuffer` test, which is missing.
--
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]