tedyu commented on code in PR #12812:
URL: https://github.com/apache/iceberg/pull/12812#discussion_r2049292649


##########
core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java:
##########
@@ -917,6 +917,15 @@ public void testLoadTable() {
         .containsAll(properties.entrySet());
   }
 
+  @Test
+  public void testLoadTableWithNonExistingNamespace() {
+    TableIdentifier ident = TableIdentifier.of("non-existing", "tbl");
+    assertThat(catalog().tableExists(ident)).as("Table should not 
exist").isFalse();
+    assertThatThrownBy(() -> catalog().loadTable(ident))
+        .isInstanceOf(NoSuchTableException.class)
+        .hasMessageStartingWith("Table does not exist: %s", ident);

Review Comment:
   I wonder if we can make more precise assertion than 
`.hasMessageStartingWith` just to avoid (unlikely) prefix match.
   
   It seems `hasMessageEndingWith` is a better choice.



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