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


##########
core/src/test/java/org/apache/iceberg/hadoop/TestHadoopTables.java:
##########
@@ -92,27 +83,23 @@ public void testDropTableWithPurge() throws IOException {
         .isInstanceOf(NoSuchTableException.class)
         .hasMessageStartingWith("Table does not exist");
 
-    Assert.assertEquals(0, dataDir.listFiles().length);
-    Assert.assertFalse(tableDir.exists());
-
-    Assert.assertFalse(TABLES.dropTable(tableDir.toURI().toString()));
+    Assertions.assertThat(Files.list(dataDir.toPath()).count()).isEqualTo(0);

Review Comment:
   given that we switched back dataDir to a File, we don't need to call 
`Files.list(..)` here right?



##########
core/src/test/java/org/apache/iceberg/hadoop/TestHadoopTables.java:
##########
@@ -92,27 +83,23 @@ public void testDropTableWithPurge() throws IOException {
         .isInstanceOf(NoSuchTableException.class)
         .hasMessageStartingWith("Table does not exist");
 
-    Assert.assertEquals(0, dataDir.listFiles().length);
-    Assert.assertFalse(tableDir.exists());
-
-    Assert.assertFalse(TABLES.dropTable(tableDir.toURI().toString()));
+    Assertions.assertThat(Files.list(dataDir.toPath()).count()).isEqualTo(0);
+    Assertions.assertThat(tableDir).doesNotExist();
+    
Assertions.assertThat(TABLES.dropTable(tableDir.toURI().toString())).isFalse();
   }
 
   @Test
   public void testDropTableWithoutPurge() throws IOException {
-    File dataDir = temp.newFolder();
-
     createDummyTable(tableDir, dataDir);
 
     TABLES.dropTable(tableDir.toURI().toString(), false);
     Assertions.assertThatThrownBy(() -> 
TABLES.load(tableDir.toURI().toString()))
         .isInstanceOf(NoSuchTableException.class)
         .hasMessageStartingWith("Table does not exist");
 
-    Assert.assertEquals(1, dataDir.listFiles().length);
-    Assert.assertFalse(tableDir.exists());
-
-    Assert.assertFalse(TABLES.dropTable(tableDir.toURI().toString()));
+    Assertions.assertThat(Files.list(dataDir.toPath()).count()).isEqualTo(1);

Review Comment:
   same here



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