skytin1004 commented on code in PR #7767:
URL: https://github.com/apache/iceberg/pull/7767#discussion_r1216761745


##########
core/src/test/java/org/apache/iceberg/io/TestByteBufferInputStreams.java:
##########
@@ -55,18 +56,22 @@ public void testReadAll() throws Exception {
     ByteBufferInputStream stream = newStream();
 
     int bytesRead = stream.read(bytes);
-    Assert.assertEquals("Should read the entire buffer", bytes.length, 
bytesRead);
+    Assertions.assertThat(bytesRead).as("Should read the entire 
buffer").isEqualTo(bytes.length);
 
     for (int i = 0; i < bytes.length; i += 1) {
-      Assert.assertEquals("Byte i should be i", i, bytes[i]);
-      Assert.assertEquals("Should advance position", 35, stream.getPos());
+      Assertions.assertThat(bytes[i]).as("Byte i should be 
i").isEqualTo((byte) i);

Review Comment:
   This casting`(byte) i` is required. This is because in JUnit 4, the 
`assertEquals` method performs automatic type conversion when comparing values 
of different types. But in AssertJ, the `assertThat` method does not perform 
automatic type conversion.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to