@BeforeClass
  public static void setupHS2() throws Exception {
    MOCK_JWKS_SERVER.stubFor(get("/jwks")
        .willReturn(ok()
            .withBody(Files.readAllBytes(jwtVerificationJWKSFile.toPath()))));

    HiveConf conf = new HiveConf();
    conf.setBoolVar(ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
    conf.setBoolVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED, false);
    conf.setBoolVar(ConfVars.HIVE_STATS_COL_AUTOGATHER, false);
    conf.setVar(ConfVars.HIVE_SERVER2_AUTHENTICATION, "JWT");
    // the content of the URL below is the same as jwtVerificationJWKSFile
    conf.setVar(ConfVars.HIVE_SERVER2_AUTHENTICATION_JWT_JWKS_URL, "http://localhost:" + MOCK_JWKS_SERVER_PORT +
        "/jwks");
    miniHS2 = new MiniHS2.Builder().withConf(conf).withHTTPTransport().build();

    miniHS2.start(new HashMap<>());
  }
This is a hack to make environment variables modifiable.
Ref: https://stackoverflow.com/questions/318239/how-do-i-set-environment-variables-from-java.
itests/hive-unit/src/test/java/org/apache/hive/service/auth/jwt/TestHttpJwtAuthentication.java