deniskuzZ commented on code in PR #6002:
URL: https://github.com/apache/hive/pull/6002#discussion_r2273591514


##########
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/properties/HMSServletTest1.java:
##########
@@ -57,23 +66,32 @@ public void tearDown() throws Exception {
   @Override
   protected PropertyClient createClient(Configuration conf, int sport) throws 
Exception {
     String path = MetastoreConf.getVar(conf, 
MetastoreConf.ConfVars.PROPERTIES_SERVLET_PATH);
-    URL url = new URL("http://hive@localhost:"; + sport + "/" + path + "/" + 
NS);
+    String scheme = MetastoreConf.getBoolVar(conf, 
MetastoreConf.ConfVars.USE_SSL)
+            ? "https" : "http";
+    URI uri = new URI(scheme + "://hive@localhost:" + sport + "/" + path + "/" 
+ NS);
     String jwt = generateJWT();
-    return new JSonHttpClient(jwt, url.toString());
+    return new JsonHttpClient(conf, jwt, uri);
+  }
+
+  protected static HttpClient createHttpClient(Configuration conf) {
+    SSLContext sslCtxt = clientSSLContextFactory(conf);
+    return sslCtxt != null
+            ? 
HttpClients.custom().setSSLContext(sslCtxt).setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE).build()
+            : HttpClients.createDefault();
   }
 
   /**
    * A property client that uses Apache HttpClient as base.
    */
-  public static class JSonHttpClient implements HttpPropertyClient, 
AutoCloseable {
-    private final String uri;
+  public static class JsonHttpClient implements HttpPropertyClient, 
AutoCloseable {

Review Comment:
   inner classes are usually declared as private static



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to