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



##########
File path: core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java
##########
@@ -554,6 +555,66 @@ 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));

Review comment:
       Can you make a separate test, 
`testCreateNamespaceFailsWithoutNamespaceProperties()`?
   
   That way, there would be something in the code that self-documents that we 
are intentional about needing namespace properties.
   
   You could then even do something like the following
   ```java
   AssertHelpers.assertThrows(
       "JDBC catalog cannot create a namespace without adding namespace 
properties as the properties are used as an existence check for RDBMs that 
don't support an atomic compare and swap",
       ...
   ```




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