rdblue commented on a change in pull request #1101:
URL: https://github.com/apache/iceberg/pull/1101#discussion_r466023724



##########
File path: core/src/test/java/org/apache/iceberg/TestMergeAppend.java
##########
@@ -75,17 +85,30 @@ public void testEmptyTableAppendManifest() throws 
IOException {
 
     TableMetadata base = readMetadata();
     Assert.assertNull("Should not have a current snapshot", 
base.currentSnapshot());
+    Assert.assertEquals("Last sequence number should be 0", 0, 
base.lastSequenceNumber());
 
     ManifestFile manifest = writeManifest(FILE_A, FILE_B);
-    Snapshot pending = table.newAppend()
+    table.newAppend()
         .appendManifest(manifest)
-        .apply();
+        .commit();
+
+    Snapshot committedSnapshot = table.currentSnapshot();
+    Assert.assertNotNull("Should create a snapshot", table.currentSnapshot());
+    V1Assert.assertEquals("Last sequence number should be 0", 0, 
table.ops().current().lastSequenceNumber());
+    V2Assert.assertEquals("Last sequence number should be 1", 1, 
table.ops().current().lastSequenceNumber());
 
-    validateSnapshot(base.currentSnapshot(), pending, FILE_A, FILE_B);
+    validateSnapshot(base.currentSnapshot(), committedSnapshot, FILE_A, 
FILE_B);
+
+    long snapshotId = committedSnapshot.snapshotId();
+    validateManifest(committedSnapshot.allManifests().get(0),

Review comment:
       Before accessing a list item using `get`, you should always assert that 
the list has the number of items you expect. That helps avoid problems where 
you're validating the wrong item because there are more than you expected, and 
also provides a better error when there are no items at all.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to