nastra commented on code in PR #9217:
URL: https://github.com/apache/iceberg/pull/9217#discussion_r1443033477
##########
core/src/test/java/org/apache/iceberg/TestCreateSnapshotEvent.java:
##########
@@ -40,76 +41,76 @@ public TestCreateSnapshotEvent(int formatVersion) {
Listeners.register(new MyListener(), CreateSnapshotEvent.class);
}
- @Test
+ @TestTemplate
public void testAppendCommitEvent() {
- Assert.assertEquals("Table should start empty", 0,
listManifestFiles().size());
+ Assertions.assertThat(listManifestFiles()).as("Table should start
empty").isEmpty();
table.newAppend().appendFile(FILE_A).commit();
- Assert.assertNotNull(currentEvent);
- Assert.assertEquals(
- "Added records in the table should be 1", "1",
currentEvent.summary().get("added-records"));
- Assert.assertEquals(
- "Added files in the table should be 1",
- "1",
- currentEvent.summary().get("added-data-files"));
- Assert.assertEquals(
- "Total records in the table should be 1", "1",
currentEvent.summary().get("total-records"));
- Assert.assertEquals(
- "Total data files in the table should be 1",
- "1",
- currentEvent.summary().get("total-data-files"));
+ Assertions.assertThat(currentEvent).isNotNull();
+ Assertions.assertThat(currentEvent.summary().get("added-records"))
Review Comment:
can be simplified to
```
assertThat(currentEvent.summary())
.containsEntry("added-records", "1")
.containsEntry("added-data-files", "1")
.containsEntry("total-records", "1")
.containsEntry("total-data-files", "1");
```
--
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]