fqaiser94 commented on code in PR #6513:
URL: https://github.com/apache/iceberg/pull/6513#discussion_r1142708323


##########
core/src/test/java/org/apache/iceberg/TestTransaction.java:
##########
@@ -771,4 +773,88 @@ public void 
testSimpleTransactionNotDeletingMetadataOnUnknownSate() throws IOExc
     Assert.assertTrue("Manifest file should exist", new 
File(manifests.get(0).path()).exists());
     Assert.assertEquals("Should have 2 files in metadata", 2, 
countAllMetadataFiles(tableDir));
   }
+
+  @Test
+  public void testValidationPasses() {
+    Assert.assertEquals("Table should be on version 0", 0, (int) version());
+
+    Transaction txn = table.newTransaction();
+    AppendFiles appendFiles = txn.newAppend().appendFile(FILE_A);
+    appendFiles.validateCurrentTable(currentTable -> true, "Custom validation 
failed.");
+    appendFiles.commit();
+    txn.commitTransaction();
+
+    Assert.assertEquals("Table should be on version 1 after commit", 1, (int) 
version());
+  }
+
+  @Test
+  public void testValidationFails() {
+    Assert.assertEquals("Table should be on version 0", 0, (int) version());
+
+    Transaction txn = table.newTransaction();
+    AssertHelpers.assertThrows(

Review Comment:
   Fixed. 



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