You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "liuxiaocs7 (via GitHub)" <gi...@apache.org> on 2023/03/21 12:41:47 UTC

[GitHub] [iceberg] liuxiaocs7 commented on a diff in pull request #7159: MR: Remove deprecate AssertHelpers

liuxiaocs7 commented on code in PR #7159:
URL: https://github.com/apache/iceberg/pull/7159#discussion_r1143314803


##########
mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java:
##########
@@ -272,13 +269,12 @@ public void testCreateDropTableNonDefaultCatalog() throws TException, Interrupte
 
     shell.executeStatement("DROP TABLE default.customers");
     // Check if the table was really dropped even from the Catalog
-    AssertHelpers.assertThrows(
-        "should throw exception",
-        NoSuchTableException.class,
-        "Table does not exist",
-        () -> {
-          testTables.loadTable(identifier);
-        });
+    Assertions.assertThatThrownBy(
+            () -> {
+              testTables.loadTable(identifier);
+            })
+        .isInstanceOf(NoSuchTableException.class)
+        .hasMessageStartingWith("Table does not exist");

Review Comment:
   There are two cases:
   
   ```shell
   Expecting actual:
     "Table does not exist: default.customers"
   ```
   
   ```shell
   Expecting actual:
     "Table does not exist at location: /tmp/junit7233921062738785052/default/customers"
   ```
   
   so i use `hasMessageStartingWith` 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-unsubscribe@iceberg.apache.org

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


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