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


##########
core/src/test/java/org/apache/iceberg/TestTableMetadata.java:
##########
@@ -1640,56 +1506,55 @@ public void 
testUpgradeV1MetadataToV2ThroughTableProperty() {
         meta.replaceProperties(
             ImmutableMap.of(TableProperties.FORMAT_VERSION, "2", "key2", 
"val2"));
 
-    Assert.assertEquals(
-        "format version should be configured based on the format-version key",
-        2,
-        meta.formatVersion());
-    Assert.assertEquals(
-        "should not contain format-version but should contain new properties",
-        ImmutableMap.of("key2", "val2"),
-        meta.properties());
+    assertThat(meta.formatVersion())
+        .as("format version should be configured based on the format-version 
key")
+        .isEqualTo(2);
+    assertThat(meta.properties())
+        .as("should not contain format-version but should contain new 
properties")
+        .containsEntry("key2", "val2");
   }
 
   @Test
   public void testParseStatisticsFiles() throws Exception {
     String data = 
readTableMetadataInputFile("TableMetadataStatisticsFiles.json");
     TableMetadata parsed = TableMetadataParser.fromJson(data);
-    Assertions.assertThat(parsed.statisticsFiles()).as("parsed statistics 
files").hasSize(1);
-    Assert.assertEquals(
-        "parsed statistics file",
-        new GenericStatisticsFile(
-            3055729675574597004L,
-            "s3://a/b/stats.puffin",
-            413,
-            42,
-            ImmutableList.of(
-                new GenericBlobMetadata(
-                    "ndv", 3055729675574597004L, 1, ImmutableList.of(1), 
ImmutableMap.of()))),
-        Iterables.getOnlyElement(parsed.statisticsFiles()));
+    assertThat(parsed.statisticsFiles()).as("parsed statistics 
files").hasSize(1);
+    assertThat(parsed.statisticsFiles())
+        .as("parsed statistics file")
+        .hasSize(1)
+        .first()
+        .isEqualTo(
+            new GenericStatisticsFile(
+                3055729675574597004L,
+                "s3://a/b/stats.puffin",
+                413,
+                42,
+                ImmutableList.of(
+                    new GenericBlobMetadata(
+                        "ndv", 3055729675574597004L, 1, ImmutableList.of(1), 
ImmutableMap.of()))));
   }
 
   @Test
   public void testParsePartitionStatisticsFiles() throws Exception {
     String data = 
readTableMetadataInputFile("TableMetadataPartitionStatisticsFiles.json");
     TableMetadata parsed = TableMetadataParser.fromJson(data);
-    Assertions.assertThat(parsed.partitionStatisticsFiles())
+    assertThat(parsed.partitionStatisticsFiles())
         .as("parsed partition statistics files")

Review Comment:
   I don't think `.as()` is helpful here, so let's just remove it



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to