nastra commented on code in PR #9927: URL: https://github.com/apache/iceberg/pull/9927#discussion_r1525212050
########## 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") Review Comment: I don't think `.as()` is helpful here, so let's just remove it ########## 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); 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