nastra commented on code in PR #11093: URL: https://github.com/apache/iceberg/pull/11093#discussion_r1822083568
########## open-api/src/testFixtures/java/org/apache/iceberg/rest/RESTCatalogServer.java: ########## @@ -37,12 +38,19 @@ public class RESTCatalogServer { private static final Logger LOG = LoggerFactory.getLogger(RESTCatalogServer.class); - static final String REST_PORT = "rest.port"; + public static final String REST_PORT = "rest.port"; static final int REST_PORT_DEFAULT = 8181; private Server httpServer; + private final Map<String, String> config; - RESTCatalogServer() {} + public RESTCatalogServer() { + this.config = Maps.newHashMap(); + } + + public RESTCatalogServer(Map<String, String> config) { Review Comment: ```suggestion RESTCatalogServer(Map<String, String> config) { ``` ########## open-api/src/testFixtures/java/org/apache/iceberg/rest/RESTCatalogServer.java: ########## @@ -37,12 +38,19 @@ public class RESTCatalogServer { private static final Logger LOG = LoggerFactory.getLogger(RESTCatalogServer.class); - static final String REST_PORT = "rest.port"; + public static final String REST_PORT = "rest.port"; static final int REST_PORT_DEFAULT = 8181; private Server httpServer; + private final Map<String, String> config; - RESTCatalogServer() {} + public RESTCatalogServer() { Review Comment: ```suggestion RESTCatalogServer() { ``` ########## spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java: ########## @@ -59,18 +104,28 @@ protected static Object[][] parameters() { } @BeforeAll - public static void createWarehouse() throws IOException { - TestBaseWithCatalog.warehouse = File.createTempFile("warehouse", null); - assertThat(warehouse.delete()).isTrue(); + public static void setUpAll() { + initRESTCatalog(); } @AfterAll - public static void dropWarehouse() throws IOException { + public static void tearDownAll() throws Exception { if (warehouse != null && warehouse.exists()) { Path warehousePath = new Path(warehouse.getAbsolutePath()); FileSystem fs = warehousePath.getFileSystem(hiveConf); assertThat(fs.delete(warehousePath, true)).as("Failed to delete " + warehousePath).isTrue(); } + stopRESTCatalog(); + } + + private static void initRESTCatalog() { + restCatalog = RCKUtils.initCatalogClient(CONFIG); Review Comment: maybe just add ``` public Map<String, String> config() { return config; } ``` to the extension class, so that this can be changed to ```suggestion restCatalog = RCKUtils.initCatalogClient(restServerExtension.config()); ``` -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org