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


##########
data/src/test/java/org/apache/iceberg/io/TestPartitioningWriters.java:
##########
@@ -137,11 +137,10 @@ public void testClusteredDataWriterOutOfOrderPartitions() 
throws IOException {
     writer.write(toRow(4, "bbb"), spec, partitionKey(spec, "bbb"));
     writer.write(toRow(5, "ccc"), spec, partitionKey(spec, "ccc"));
 
-    AssertHelpers.assertThrows(
-        "Should fail to write out of order partitions",
-        IllegalStateException.class,
-        "Encountered records that belong to already closed files",
-        () -> writer.write(toRow(6, "aaa"), spec, partitionKey(spec, "aaa")));
+    Assertions.assertThatThrownBy(
+            () -> writer.write(toRow(6, "aaa"), spec, partitionKey(spec, 
"aaa")))
+        .isInstanceOf(IllegalStateException.class)
+        .hasMessageContaining("Encountered records that belong to already 
closed files");

Review Comment:
   it's ok to use `hasMessageContaining` in such cases, I was just trying to 
point out that it would be generally good to re-visit the error msg check and 
make it as strict as possible (obviously where it makes sense)



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