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


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestPositionDeletesTable.java:
##########
@@ -1051,24 +1086,24 @@ public void testWritePartitionEvolutionDisallowed() 
throws Exception {
               .option(SparkReadOptions.SCAN_TASK_SET_ID, fileSetID)
               .option(SparkReadOptions.FILE_OPEN_COST, Integer.MAX_VALUE)
               .load(posDeletesTableName);
-      Assert.assertEquals(1, scanDF.javaRDD().getNumPartitions());
+      assertThat(scanDF.javaRDD().getNumPartitions()).isEqualTo(1);
 
       // Add partition field to render the original un-partitioned dataset 
un-commitable
       tab.updateSpec().addField("data").commit();
     }
 
-    Assert.assertThrows(
-        AnalysisException.class,
-        () ->
-            scanDF
-                .writeTo(posDeletesTableName)
-                .option(SparkWriteOptions.REWRITTEN_FILE_SCAN_TASK_SET_ID, 
fileSetID)
-                .append());
+    assertThatThrownBy(
+            () ->
+                scanDF
+                    .writeTo(posDeletesTableName)
+                    .option(SparkWriteOptions.REWRITTEN_FILE_SCAN_TASK_SET_ID, 
fileSetID)
+                    .append())
+        .isInstanceOf(AnalysisException.class);

Review Comment:
   can you please add a `.hasMessage()` check here?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to