chinmay-bhat commented on code in PR #9341:
URL: https://github.com/apache/iceberg/pull/9341#discussion_r1431357331


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/data/TestSparkRecordOrcReaderWriter.java:
##########
@@ -130,24 +130,24 @@ private static void assertRecordEquals(
     Iterator<Record> expectedIter = expected.iterator();
     Iterator<Record> actualIter = actual.iterator();
     for (int i = 0; i < size; i += 1) {
-      Assert.assertTrue("Expected iterator should have more rows", 
expectedIter.hasNext());
-      Assert.assertTrue("Actual iterator should have more rows", 
actualIter.hasNext());
-      Assert.assertEquals("Should have same rows.", expectedIter.next(), 
actualIter.next());
+      assertThat(expectedIter.hasNext()).as("Expected iterator should have 
more rows").isTrue();
+      assertThat(actualIter.hasNext()).as("Actual iterator should have more 
rows").isTrue();
+      assertThat(actualIter.next()).as("Should have same 
rows.").isEqualTo(expectedIter.next());
     }
-    Assert.assertFalse("Expected iterator should not have any extra rows.", 
expectedIter.hasNext());
-    Assert.assertFalse("Actual iterator should not have any extra rows.", 
actualIter.hasNext());
+    assertThat(expectedIter.hasNext()).as("Expected iterator should not have 
any extra rows.").isFalse();
+    assertThat(actualIter.hasNext()).as("Actual iterator should not have any 
extra rows.").isFalse();

Review Comment:
   I know we can run 
   `assertThat(expectedIter.hasNext()).as("Expected iterator should have more 
rows").isTrue();` as 
   `assertThat(expectedIter).as("Expected iterator should have more 
rows").hasNext();`
   
   But I don't see a similar iterator functionality when the case isFalse() i.e 
   `assertThat(expectedIter).as("Expected iterator should have more 
rows").doesntHaveNext();`
   
   So I've retained the old format. Do let me know if this can be improved!



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to