nastra commented on code in PR #7861:
URL: https://github.com/apache/iceberg/pull/7861#discussion_r1238679587
##########
core/src/test/java/org/apache/iceberg/hadoop/TestHadoopCommits.java:
##########
@@ -67,55 +64,59 @@ public class TestHadoopCommits extends HadoopTableTestBase {
public void testCreateTable() throws Exception {
PartitionSpec expectedSpec =
PartitionSpec.builderFor(TABLE_SCHEMA).bucket("data", 16).build();
- Assert.assertEquals(
- "Table schema should match schema with reassigned ids",
- TABLE_SCHEMA.asStruct(),
- table.schema().asStruct());
- Assert.assertEquals(
- "Table partition spec should match with reassigned ids", expectedSpec,
table.spec());
+ Assertions.assertThat(table.schema().asStruct())
+ .as("Table schema should match schema with reassigned ids")
+ .isEqualTo(TABLE_SCHEMA.asStruct());
+ Assertions.assertThat(table.spec())
+ .as("Table partition spec should match with reassigned ids")
+ .isEqualTo(expectedSpec);
List<FileScanTask> tasks = Lists.newArrayList(table.newScan().planFiles());
- Assert.assertEquals("Should not create any scan tasks", 0, tasks.size());
-
- Assert.assertTrue("Table location should exist", tableDir.exists());
- Assert.assertTrue(
- "Should create metadata folder", metadataDir.exists() &&
metadataDir.isDirectory());
- Assert.assertTrue("Should create v1 metadata", version(1).exists() &&
version(1).isFile());
- Assert.assertFalse("Should not create v2 or newer versions",
version(2).exists());
- Assert.assertTrue("Should create version hint file",
versionHintFile.exists());
- Assert.assertEquals("Should write the current version to the hint file",
1, readVersionHint());
-
+ Assertions.assertThat(tasks).as("Should not create any scan
tasks").isEmpty();
+ Assertions.assertThat(tableDir).as("Table location should exist").exists();
+ Assertions.assertThat(metadataDir.exists() && metadataDir.isDirectory())
+ .as("Should create metadata folder")
+ .isTrue();
+ Assertions.assertThat(version(1).exists() && version(1).isFile())
+ .as("Should create v1 metadata")
+ .isTrue();
+ Assertions.assertThat(version(2).exists())
Review Comment:
```suggestion
Assertions.assertThat(version(2)).exists()
```
--
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]