nastra commented on code in PR #9341:
URL: https://github.com/apache/iceberg/pull/9341#discussion_r1434243638


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestDataFrameWrites.java:
##########
@@ -186,21 +185,24 @@ private void writeAndValidateWithLocations(Table table, 
File location, File expe
     while (expectedIter.hasNext() && actualIter.hasNext()) {
       assertEqualsSafe(tableSchema.asStruct(), expectedIter.next(), 
actualIter.next());
     }
-    Assert.assertEquals(
-        "Both iterators should be exhausted", expectedIter.hasNext(), 
actualIter.hasNext());
+    assertThat(actualIter.hasNext())
+        .as("Both iterators should be exhausted")
+        .isEqualTo(expectedIter.hasNext());
 
     table
         .currentSnapshot()
         .addedDataFiles(table.io())
         .forEach(
             dataFile ->
-                Assert.assertTrue(
-                    String.format(
-                        "File should have the parent directory %s, but has: 
%s.",
-                        expectedDataDir.getAbsolutePath(), dataFile.path()),
-                    URI.create(dataFile.path().toString())
-                        .getPath()
-                        .startsWith(expectedDataDir.getAbsolutePath())));
+                assertThat(
+                        URI.create(dataFile.path().toString())
+                            .getPath()
+                            .startsWith(expectedDataDir.getAbsolutePath()))

Review Comment:
   this can be written in a more fluent way (rather than using `isTrue()` at 
the end)



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