nastra commented on code in PR #5984:
URL: https://github.com/apache/iceberg/pull/5984#discussion_r999611191


##########
core/src/test/java/org/apache/iceberg/TestBaseIncrementalAppendScan.java:
##########
@@ -67,6 +116,51 @@ public void testFromSnapshotExclusive() {
     Assert.assertEquals(1, Iterables.size(scanWithToSnapshot.planFiles()));
   }
 
+  @Test
+  public void testFromSnapshotExclusiveWithBranch() {
+    table.newFastAppend().appendFile(FILE_A).commit();
+    long snapshotAId = table.currentSnapshot().snapshotId();
+
+    String branchName = "b1";
+    table.manageSnapshots().createBranch(branchName, snapshotAId).commit();
+
+    table.newFastAppend().appendFile(FILE_B).commit();
+    long snapshotBId = table.currentSnapshot().snapshotId();
+    String branchName2 = "b2";
+    table.manageSnapshots().createBranch(branchName2, snapshotBId).commit();
+
+    table.newFastAppend().appendFile(FILE_C).toBranch(branchName).commit();
+    long snapshotCId = table.snapshot(branchName).snapshotId();
+
+    IncrementalAppendScan scan = newScan().fromSnapshotExclusive(snapshotAId, 
branchName);
+    Assert.assertEquals(1, Iterables.size(scan.planFiles()));
+
+    IncrementalAppendScan scanWithToSnapshot =
+        newScan().fromSnapshotExclusive(snapshotAId, 
branchName).toSnapshot(snapshotBId);
+    Assert.assertEquals(1, Iterables.size(scanWithToSnapshot.planFiles()));
+
+    AssertHelpers.assertThrows(

Review Comment:
   nit: personally I think `Assertions.assertThatThrownBy(() -> 
newScan().fromSnapshotExclusive(snapshotCId, 
branchName2)).isInstanceOf(IllegalArgumentException.class).hasMessage(..)` is 
preferrable because `Should throw exception` doesn't really add any value



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

Reply via email to