You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by et...@apache.org on 2025/04/23 09:17:08 UTC

(iceberg) 01/01: Core: Add test when listing namespaces with a non-existing namespace

This is an automated email from the ASF dual-hosted git repository.

etudenhoefner pushed a commit to branch improve-testing
in repository https://gitbox.apache.org/repos/asf/iceberg.git

commit de2d8c305c4013238895d259bf291c894c2e5765
Author: Eduard Tudenhoefner <et...@gmail.com>
AuthorDate: Wed Apr 23 11:17:01 2025 +0200

    Core: Add test when listing namespaces with a non-existing namespace
---
 core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java b/core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java
index d8ca43bd27..1320b919d2 100644
--- a/core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java
+++ b/core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java
@@ -1226,6 +1226,13 @@ public abstract class CatalogTests<C extends Catalog & SupportsNamespaces> {
         .doesNotContain(Namespace.empty());
   }
 
+  @Test
+  public void testListNonExistingNamespace() {
+    assertThatThrownBy(() -> catalog().listNamespaces(Namespace.of("non-existing")))
+        .isInstanceOf(NoSuchNamespaceException.class)
+        .hasMessage("Namespace does not exist: non-existing");
+  }
+
   @Test
   public void createAndDropEmptyNamespace() {
     assumeThat(supportsEmptyNamespace())