nastra commented on code in PR #7861:
URL: https://github.com/apache/iceberg/pull/7861#discussion_r1238018928
##########
core/src/test/java/org/apache/iceberg/hadoop/TestHadoopTables.java:
##########
@@ -55,20 +54,19 @@ public class TestHadoopTables {
required(1, "id", Types.IntegerType.get(), "unique ID"),
required(2, "data", Types.StringType.get()));
- @Rule public TemporaryFolder temp = new TemporaryFolder();
private File tableDir = null;
- @Before
- public void setupTableLocation() throws Exception {
- tableDir = temp.newFolder();
+ @BeforeEach
+ public void setupTableLocation(@TempDir Path temp) throws Exception {
Review Comment:
the entire `setupTableLocation()` can be removed I believe
##########
core/src/test/java/org/apache/iceberg/hadoop/TestHadoopTables.java:
##########
@@ -92,15 +90,15 @@ public void testDropTableWithPurge() throws IOException {
.isInstanceOf(NoSuchTableException.class)
.hasMessageStartingWith("Table does not exist");
- Assert.assertEquals(0, dataDir.listFiles().length);
- Assert.assertFalse(tableDir.exists());
+ Assertions.assertThat(dataDir.listFiles()).hasSize(0);
+ Assertions.assertThat(tableDir).doesNotExist();
- Assert.assertFalse(TABLES.dropTable(tableDir.toURI().toString()));
+
Assertions.assertThat(TABLES.dropTable(tableDir.toURI().toString())).isFalse();
}
@Test
- public void testDropTableWithoutPurge() throws IOException {
- File dataDir = temp.newFolder();
+ public void testDropTableWithoutPurge(@TempDir Path temp) throws IOException
{
Review Comment:
why do we need the `@TempDir Path temp` parameter here? We should be able to
use `tableDir`
--
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]