private static void startMetastoreServer() throws Exception {
    port = MetaStoreTestUtils.startMetaStoreWithRetry(HadoopThriftAuthBridge.getBridge(),
        conf);
    MetastoreConf.setVar(conf, ConfVars.THRIFT_URIS, "thrift://localhost:" + port);
    System.out.println("Starting MetaStore Server on port " + port);
  }
This is a hack to make environment variables modifiable.
Ref: https://stackoverflow.com/questions/318239/how-do-i-set-environment-variables-from-java.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetastoreWithHttpJwt.java