tomtongue commented on code in PR #9927: URL: https://github.com/apache/iceberg/pull/9927#discussion_r1525693116
########## core/src/test/java/org/apache/iceberg/TestTableMetadata.java: ########## @@ -310,74 +271,40 @@ public void testBackwardCompat() throws Exception { String asJson = toJsonWithoutSpecAndSchemaList(expected); TableMetadata metadata = TableMetadataParser.fromJson(asJson); - Assert.assertEquals( - "Format version should match", expected.formatVersion(), metadata.formatVersion()); - Assert.assertNull("Table UUID should not be assigned", metadata.uuid()); - Assert.assertEquals("Table location should match", expected.location(), metadata.location()); - Assert.assertEquals( - "Last sequence number should default to 0", - expected.lastSequenceNumber(), - metadata.lastSequenceNumber()); - Assert.assertEquals( - "Last column ID should match", expected.lastColumnId(), metadata.lastColumnId()); - Assert.assertEquals( - "Current schema ID should be default to TableMetadata.INITIAL_SCHEMA_ID", - TableMetadata.INITIAL_SCHEMA_ID, - metadata.currentSchemaId()); - Assert.assertEquals("Schemas size should match", 1, metadata.schemas().size()); - Assert.assertEquals( - "Schemas should contain the schema", - metadata.schemas().get(0).asStruct(), - schema.asStruct()); - Assert.assertEquals( - "Partition spec should be the default", - expected.spec().toString(), - metadata.spec().toString()); - Assert.assertEquals( - "Default spec ID should default to TableMetadata.INITIAL_SPEC_ID", - TableMetadata.INITIAL_SPEC_ID, - metadata.defaultSpecId()); - Assert.assertEquals("PartitionSpec should contain the spec", 1, metadata.specs().size()); - Assert.assertTrue( - "PartitionSpec should contain the spec", metadata.specs().get(0).compatibleWith(spec)); - Assert.assertEquals( - "PartitionSpec should have ID TableMetadata.INITIAL_SPEC_ID", - TableMetadata.INITIAL_SPEC_ID, - metadata.specs().get(0).specId()); - Assert.assertEquals( - "lastAssignedFieldId across all PartitionSpecs should match", - expected.spec().lastAssignedFieldId(), - metadata.lastAssignedPartitionId()); - Assert.assertEquals("Properties should match", expected.properties(), metadata.properties()); - Assert.assertEquals( - "Snapshot logs should match", expected.snapshotLog(), metadata.snapshotLog()); - Assert.assertEquals( - "Current snapshot ID should match", - currentSnapshotId, - metadata.currentSnapshot().snapshotId()); - Assert.assertEquals( - "Parent snapshot ID should match", - (Long) previousSnapshotId, - metadata.currentSnapshot().parentId()); - Assert.assertEquals( - "Current snapshot files should match", - currentSnapshot.allManifests(ops.io()), - metadata.currentSnapshot().allManifests(ops.io())); - Assert.assertNull( - "Current snapshot's schema ID should be null", metadata.currentSnapshot().schemaId()); - Assert.assertEquals( - "Previous snapshot ID should match", - previousSnapshotId, - metadata.snapshot(previousSnapshotId).snapshotId()); - Assert.assertEquals( - "Previous snapshot files should match", - previousSnapshot.allManifests(ops.io()), - metadata.snapshot(previousSnapshotId).allManifests(ops.io())); - Assert.assertEquals( - "Snapshot logs should match", expected.previousFiles(), metadata.previousFiles()); - Assert.assertNull( - "Previous snapshot's schema ID should be null", - metadata.snapshot(previousSnapshotId).schemaId()); + assertThat(metadata.formatVersion()).isEqualTo(expected.formatVersion()); + assertThat(metadata.uuid()).as("Table UUID should not be assigned").isNull(); + assertThat(metadata.location()).isEqualTo(expected.location()); + assertThat(metadata.lastSequenceNumber()) + .as("Last sequence number should default to 0") + .isEqualTo(expected.lastSequenceNumber()); + + assertThat(metadata.lastColumnId()).isEqualTo(expected.lastColumnId()); + assertThat(metadata.currentSchemaId()) + .as("Current schema ID should be default to TableMetadata.INITIAL_SCHEMA_ID") + .isEqualTo(TableMetadata.INITIAL_SCHEMA_ID); + assertThat(metadata.schemas()).hasSize(1); + assertThat(schema.asStruct()).isEqualTo(metadata.schemas().get(0).asStruct()); Review Comment: oops, thank you. I'm fixing this. -- 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