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



##########
File path: 
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java
##########
@@ -118,6 +121,36 @@ public void testCreateTableWithCaching() throws Exception {
     }
   }
 
+  @Test
+  public void testInitializeWithConfig() throws Exception {
+    Map<String, String> properties = new HashMap<>();
+    HiveCatalog catalog = new HiveCatalog();
+    catalog.setConf(conf);
+    catalog.initialize("hive", properties);
+  }
+
+  @Test
+  public void testInitializenWithConfigAndProperties() throws Exception {
+    Map<String, String> properties = new HashMap<>();
+    properties.put("uri", "");
+    properties.put("warehouse", "");
+    HiveCatalog catalog = new HiveCatalog();
+    catalog.setConf(conf);
+    catalog.initialize("hive", properties);
+  }
+
+  @Test
+  public void testInitializeWithoutConfig() throws Exception {
+    Map<String, String> properties = new HashMap<>();
+    HiveCatalog catalog = new HiveCatalog();
+
+    Throwable missingConfException = 
Assert.assertThrows(RuntimeException.class, () -> {
+      catalog.initialize("hive", properties);

Review comment:
       There is an existing utility class, AssertHelpers iirc, that would allow 
you to combine this check with the following one that asserts on the message 
into one condensed call. It’s used quite liberally throughout the project. I’d 
definitely advise you take a look and see if this can be simplified via the 
existing utilities 🙂




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