rdblue commented on a change in pull request #3275:
URL: https://github.com/apache/iceberg/pull/3275#discussion_r736024700



##########
File path: core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java
##########
@@ -555,6 +555,24 @@ public void testDropNamespace() {
         "is not empty. 1 tables exist.", () -> 
catalog.dropNamespace(tbl4.namespace()));
   }
 
+  @Test
+  public void testCreateNamespace() {
+    Namespace testNamespace = Namespace.of("testDb", "ns1", "ns2");
+    // Test with null metadata
+    AssertHelpers.assertThrows("Cannot create a namespace with null or empty 
metadata", IllegalArgumentException.class,
+            () -> catalog.createNamespace(testNamespace,null));
+    Assert.assertFalse(catalog.namespaceExists(testNamespace));
+
+    // Test with metadata
+    Map<String, String> testMetadata = new HashMap<String, String>(){{
+      put("key_1", "value_1");
+      put("key_2", "value_2");
+      put("key_3", "value_3");
+    }};

Review comment:
       It may also be easier to use `ImmutableMap.of("k1", "v1", "k2", "v2", 
...);`




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