nastra commented on code in PR #9892: URL: https://github.com/apache/iceberg/pull/9892#discussion_r1519306478
########## core/src/test/java/org/apache/iceberg/TestSnapshotManager.java: ########## @@ -700,81 +686,82 @@ public void testAttemptToRollbackToCurrentSnapshot() { table.manageSnapshots().rollbackTo(currentSnapshotId).commit(); } - @Test + @TestTemplate public void testSnapshotManagerThroughTransaction() { table.newAppend().appendFile(FILE_A).commit(); Snapshot snapshotAfterFirstAppend = readMetadata().currentSnapshot(); validateSnapshot(null, snapshotAfterFirstAppend, FILE_A); table.newAppend().appendFile(FILE_B).commit(); validateSnapshot(snapshotAfterFirstAppend, readMetadata().currentSnapshot(), FILE_B); - Assert.assertEquals("Table should be on version 2 after appending twice", 2, (int) version()); + assertThat(version()).as("Table should be on version 2 after appending twice").isEqualTo(2); TableMetadata base = readMetadata(); Transaction txn = table.newTransaction(); - Assert.assertSame( - "Base metadata should not change when transaction is created", base, readMetadata()); - Assert.assertEquals( - "Table should be on version 2 after creating transaction", 2, (int) version()); + assertThat(readMetadata()) + .as("Base metadata should not change when transaction is created") + .isEqualTo(base); + assertThat(version()) + .as("Table should be on version 2 after creating transaction") + .isEqualTo(2); ManageSnapshots manageSnapshots = txn.manageSnapshots(); - Assert.assertNotNull(manageSnapshots); + assertThat(manageSnapshots).isNotNull(); - Assert.assertSame( - "Base metadata should not change when manageSnapshots is created", base, readMetadata()); - Assert.assertEquals( - "Table should be on version 2 after creating manageSnapshots", 2, (int) version()); + assertThat(readMetadata()) + .as("Base metadata should not change when manageSnapshots is created") + .isSameAs(base); + assertThat(version()) + .as("Table should be on version 2 after creating manageSnapshots") + .isEqualTo(2); manageSnapshots.rollbackTo(snapshotAfterFirstAppend.snapshotId()).commit(); - Assert.assertSame( - "Base metadata should not change when invoking rollbackTo", base, readMetadata()); - Assert.assertEquals( - "Table should be on version 2 after invoking rollbackTo", 2, (int) version()); + assertThat(readMetadata()) + .as("Base metadata should not change when invoking rollbackTo") + .isSameAs(base); + assertThat(version()).as("Table should be on version 2 after invoking rollbackTo").isEqualTo(2); txn.commitTransaction(); - Assert.assertEquals(snapshotAfterFirstAppend, readMetadata().currentSnapshot()); + assertThat(readMetadata().currentSnapshot()).isSameAs(snapshotAfterFirstAppend); Review Comment: ```suggestion assertThat(readMetadata().currentSnapshot()).isEqualTo(snapshotAfterFirstAppend); ``` -- 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