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


##########
core/src/test/java/org/apache/iceberg/hadoop/TestHadoopCatalog.java:
##########
@@ -69,10 +68,10 @@ public void testCreateTableBuilder() throws Exception {
             .withProperties(ImmutableMap.of("key2", "value2"))
             .create();
 
-    Assert.assertEquals(TABLE_SCHEMA.toString(), table.schema().toString());
-    Assert.assertEquals(1, table.spec().fields().size());
-    Assert.assertEquals("value1", table.properties().get("key1"));
-    Assert.assertEquals("value2", table.properties().get("key2"));
+    
Assertions.assertThat(table.schema().toString()).isEqualTo(TABLE_SCHEMA.toString());
+    Assertions.assertThat(table.spec().fields()).hasSize(1);
+    Assertions.assertThat(table.properties()).containsEntry("key1", "value1");
+    Assertions.assertThat(table.properties()).containsEntry("key2", "value2");

Review Comment:
   Based on your review, I've modified the code to be more concise.



##########
core/src/test/java/org/apache/iceberg/hadoop/TestHadoopCatalog.java:
##########
@@ -105,23 +104,25 @@ public void testReplaceTxnBuilder() throws Exception {
     createTxn.commitTransaction();
 
     Table table = catalog.loadTable(tableIdent);
-    Assert.assertNotNull(table.currentSnapshot());
+    Assertions.assertThat(table.currentSnapshot()).isNotNull();
 
     Transaction replaceTxn =
         catalog.buildTable(tableIdent, SCHEMA).withProperty("key2", 
"value2").replaceTransaction();
     replaceTxn.commitTransaction();
 
     table = catalog.loadTable(tableIdent);
-    Assert.assertNull(table.currentSnapshot());
+    Assertions.assertThat(table.currentSnapshot()).isNull();
     PartitionSpec v1Expected =
         PartitionSpec.builderFor(table.schema())
             .alwaysNull("data", "data_bucket")
             .withSpecId(1)
             .build();
-    Assert.assertEquals("Table should have a spec with one void field", 
v1Expected, table.spec());
+    Assertions.assertThat(table.spec())
+        .as("Table should have a spec with one void field")
+        .isEqualTo(v1Expected);
 
-    Assert.assertEquals("value1", table.properties().get("key1"));
-    Assert.assertEquals("value2", table.properties().get("key2"));
+    Assertions.assertThat(table.properties()).containsEntry("key1", "value1");
+    Assertions.assertThat(table.properties()).containsEntry("key2", "value2");

Review Comment:
   Based on your review, I've modified the code to be more concise.



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