andrew4699 commented on code in PR #391:
URL: https://github.com/apache/polaris/pull/391#discussion_r1821608255


##########
polaris-service/src/test/java/org/apache/polaris/service/test/TestEnvironmentExtension.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.test;
+
+import static 
org.apache.polaris.service.test.PolarisConnectionExtension.findDropwizardExtension;
+
+import io.dropwizard.testing.junit5.DropwizardAppExtension;
+import jakarta.ws.rs.client.Client;
+import java.util.Optional;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ParameterContext;
+import org.junit.jupiter.api.extension.ParameterResolutionException;
+import org.junit.jupiter.api.extension.ParameterResolver;
+
+/**
+ * JUnit test extension that constructs a TestEnvironment. It tries to use 
environment variables and
+ * falls back to communicating with the local Dropwizard instance.
+ */
+public class TestEnvironmentExtension implements ParameterResolver {
+  /**
+   * Environment variable that specifies the Polaris base URL to use. If this 
is not set, falls back
+   * to the root path of your Dropwizard instance.
+   */
+  public static final String ENV_BASE_URL = "INTEGRATION_TEST_BASE_URL";
+
+  /**
+   * Environment variable that specifies the HTTP client factory that should 
construct test HTTP
+   * clients. This should be a class name. If this is not set, falls back to 
the client created by
+   * Dropwizard.
+   */
+  public static final String ENV_HTTP_CLIENT_FACTORY_IMPL =

Review Comment:
   For things like this the project seems to have relied on providing a test 
config file and Jackson parsing the config. I'm hoping to decouple this from 
Dropwizard and for non-Dropwizard environments also not force people to go 
through that whole dance.



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

Reply via email to