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


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java:
##########
@@ -1179,4 +1179,25 @@ public void 
testDatabaseLocationWithSlashInWarehouseDir() {
 
     assertThat(database.getLocationUri()).isEqualTo("s3://bucket/database.db");
   }
+
+  @Test
+  public void testListNamespacesWithEmptyNamespace() {
+    Namespace namespaceWithOneLevel = Namespace.of("parent");
+    assertThat(catalog.listNamespaces(namespaceWithOneLevel))
+        .as("Namespace with one level will return zero namespace.")
+        .hasSize(0);
+
+    Namespace namespaceWithTwoLevel = Namespace.of("parent", "child1");
+    assertThatThrownBy(() -> catalog.listNamespaces(namespaceWithTwoLevel))
+        .isInstanceOf(NoSuchNamespaceException.class)
+        .hasMessageContaining("Namespace does not exist");
+
+    assertThat(catalog.listNamespaces(Namespace.empty()))
+        .as("Empty namespace should return two namespaces.")
+        .hasSize(2);

Review Comment:
   which namespaces are being returned here? I think the check should include 
what's being returned: `.containsExactly(...)`



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