kbendick commented on code in PR #4495:
URL: https://github.com/apache/iceberg/pull/4495#discussion_r847723588


##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -42,20 +50,29 @@ public void createCatalog() {
     File warehouse = temp.toFile();
     Configuration conf = new Configuration();
 
-    JdbcCatalog backendCatalog = new JdbcCatalog();
-    backendCatalog.setConf(conf);
-    Map<String, String> backendCatalogProperties = ImmutableMap.of(
-        CatalogProperties.WAREHOUSE_LOCATION, warehouse.getAbsolutePath(),
-        CatalogProperties.URI, "jdbc:sqlite:file::memory:?ic" + 
UUID.randomUUID().toString().replace("-", ""),
-        JdbcCatalog.PROPERTY_PREFIX + "username", "user",
-        JdbcCatalog.PROPERTY_PREFIX + "password", "password");
-    backendCatalog.initialize("backend", backendCatalogProperties);
+    this.restCatalog = new RESTCatalog((config) -> {
+      JdbcCatalog backendCatalog = new JdbcCatalog();
+      backendCatalog.setConf(conf);
+      Map<String, String> backendCatalogProperties = ImmutableMap.of(
+          CatalogProperties.WAREHOUSE_LOCATION, warehouse.getAbsolutePath(),
+          CatalogProperties.URI, "jdbc:sqlite:file::memory:?ic" + 
UUID.randomUUID().toString().replace("-", ""),
+          JdbcCatalog.PROPERTY_PREFIX + "username", "user",
+          JdbcCatalog.PROPERTY_PREFIX + "password", "password");

Review Comment:
   Updated to close the `backendCatalog` in `@AfterEach` and left a comment in 
the `RESTCatalogAdapter`'s `close` method that the caller is responsible for 
closing.
   
   Let me know if you think the comment is unnecessary.



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