kbendick commented on a change in pull request #3252:
URL: https://github.com/apache/iceberg/pull/3252#discussion_r725468783
##########
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);
Review comment:
Nit - I understand the point of these tests, but it’s a bit strange to
me seeing a test with no asssrtions.
I believe there are some JUnit functions or Assertions4J functions for
asserting that something doesn’t throw. Maybe those would enhance readability?
For people familiar with JUnit, arguably the lack of a `@throws(…)` tag is
sufficient, but something to consider 🙂
##########
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 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]