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


##########
core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java:
##########
@@ -614,20 +621,23 @@ public void testCompleteCreateTable() {
             .create();
 
     // validate table settings
-    Assert.assertEquals(
-        "Table name should report its full name", catalog.name() + "." + 
ident, table.name());
-    Assert.assertTrue("Table should exist", catalog.tableExists(ident));
-    Assert.assertEquals(
-        "Schema should match expected ID assignment",
-        TABLE_SCHEMA.asStruct(),
-        table.schema().asStruct());
-    Assert.assertNotNull("Should have a location", table.location());
-    Assert.assertEquals("Should use requested partition spec", TABLE_SPEC, 
table.spec());
-    Assert.assertEquals("Should use requested write order", TABLE_WRITE_ORDER, 
table.sortOrder());
-    Assert.assertEquals(
-        "Table properties should be a superset of the requested properties",
-        properties.entrySet(),
-        Sets.intersection(properties.entrySet(), 
table.properties().entrySet()));
+    Assertions.assertThat(table.name())
+        .as("Table name should report its full name")
+        .isEqualTo(catalog.name() + "." + ident);
+    Assertions.assertThat(catalog.tableExists(ident)).as("Table should 
exist").isTrue();
+    Assertions.assertThat(table.schema().asStruct())
+        .as("Schema should match expected ID assignment")
+        .isEqualTo(TABLE_SCHEMA.asStruct());
+    Assertions.assertThat(table.location()).as("Should have a 
location").isNotNull();
+    Assertions.assertThat(table.spec())
+        .as("Should use requested partition spec")
+        .isEqualTo(TABLE_SPEC);
+    Assertions.assertThat(table.sortOrder())
+        .as("Should use requested write order")
+        .isEqualTo(TABLE_WRITE_ORDER);
+    Assertions.assertThat(table.properties().entrySet())
+        .as("Table properties should be a superset of the requested 
properties")
+        .containsAll(properties.entrySet());

Review Comment:
   should that be containsExactlyInAnyOrder?



##########
core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java:
##########
@@ -548,20 +556,20 @@ public void testTableNameWithDot() {
       catalog.createNamespace(Namespace.of("ns"));
     }
 
-    Assert.assertFalse("Table should not exist", catalog.tableExists(ident));
+    Assertions.assertThat(catalog.tableExists(ident)).as("Table should not 
exist").isFalse();
 
     catalog.buildTable(ident, SCHEMA).create();
-    Assert.assertTrue("Table should exist", catalog.tableExists(ident));
+

Review Comment:
   nit: unnecessary newline



##########
core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java:
##########
@@ -651,24 +661,27 @@ public void testLoadTable() {
         .withSortOrder(WRITE_ORDER)
         .withProperties(properties)
         .create();
-    Assert.assertTrue("Table should exist", catalog.tableExists(ident));
+    Assertions.assertThat(catalog.tableExists(ident)).as("Table should 
exist").isTrue();
 
     Table table = catalog.loadTable(ident);
     // validate table settings
-    Assert.assertEquals(
-        "Table name should report its full name", catalog.name() + "." + 
ident, table.name());
-    Assert.assertTrue("Table should exist", catalog.tableExists(ident));
-    Assert.assertEquals(
-        "Schema should match expected ID assignment",
-        TABLE_SCHEMA.asStruct(),
-        table.schema().asStruct());
-    Assert.assertNotNull("Should have a location", table.location());
-    Assert.assertEquals("Should use requested partition spec", TABLE_SPEC, 
table.spec());
-    Assert.assertEquals("Should use requested write order", TABLE_WRITE_ORDER, 
table.sortOrder());
-    Assert.assertEquals(
-        "Table properties should be a superset of the requested properties",
-        properties.entrySet(),
-        Sets.intersection(properties.entrySet(), 
table.properties().entrySet()));
+    Assertions.assertThat(table.name())
+        .as("Table name should report its full name")
+        .isEqualTo(catalog.name() + "." + ident);
+    Assertions.assertThat(catalog.tableExists(ident)).as("Table should 
exist").isTrue();
+    Assertions.assertThat(table.schema().asStruct())
+        .as("Schema should match expected ID assignment")
+        .isEqualTo(TABLE_SCHEMA.asStruct());
+    Assertions.assertThat(table.location()).as("Should have a 
location").isNotNull();
+    Assertions.assertThat(table.spec())
+        .as("Should use requested partition spec")
+        .isEqualTo(TABLE_SPEC);
+    Assertions.assertThat(table.sortOrder())
+        .as("Should use requested write order")
+        .isEqualTo(TABLE_WRITE_ORDER);
+    Assertions.assertThat(table.properties().entrySet())
+        .as("Table properties should be a superset of the requested 
properties")
+        .containsAll(properties.entrySet());

Review Comment:
   containsExactlyInAnyOrder?



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