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


##########
core/src/test/java/org/apache/iceberg/TestFastAppend.java:
##########
@@ -555,19 +555,22 @@ public void testAppendToBranchEmptyTable() {
 
   @Test
   public void testAppendToNullBranchFails() {
-    AssertHelpers.assertThrows(
-        "Invalid branch",
-        IllegalArgumentException.class,
-        () -> table.newFastAppend().appendFile(FILE_A).toBranch(null));
+    Assertions.assertThatThrownBy(() -> 
table.newFastAppend().appendFile(FILE_A).toBranch(null))
+        .as("Invalid branch")
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessageContaining("Invalid branch name: null");

Review Comment:
   nit: `hasMessage` would be better here, since we can match the full error msg



##########
core/src/test/java/org/apache/iceberg/TestFastAppend.java:
##########
@@ -555,19 +555,22 @@ public void testAppendToBranchEmptyTable() {
 
   @Test
   public void testAppendToNullBranchFails() {
-    AssertHelpers.assertThrows(
-        "Invalid branch",
-        IllegalArgumentException.class,
-        () -> table.newFastAppend().appendFile(FILE_A).toBranch(null));
+    Assertions.assertThatThrownBy(() -> 
table.newFastAppend().appendFile(FILE_A).toBranch(null))
+        .as("Invalid branch")
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessageContaining("Invalid branch name: null");
   }
 
   @Test
   public void testAppendToTagFails() {
     table.newFastAppend().appendFile(FILE_A).commit();
     table.manageSnapshots().createTag("some-tag", 
table.currentSnapshot().snapshotId()).commit();
-    AssertHelpers.assertThrows(
-        "Invalid branch",
-        IllegalArgumentException.class,
-        () -> 
table.newFastAppend().appendFile(FILE_A).toBranch("some-tag").commit());
+
+    Assertions.assertThatThrownBy(
+            () -> 
table.newFastAppend().appendFile(FILE_A).toBranch("some-tag").commit())
+        .as("Invalid branch")
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessageContaining(

Review Comment:
   nit: `hasMessage` would be better here, since we can match the full error msg



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