public static MiniHS2 getMiniHS2WithKerbWithRemoteHMS(MiniHiveKdc miniHiveKdc, HiveConf hiveConf,
      String authType) throws Exception {
    String hivePrincipal =
        miniHiveKdc.getFullyQualifiedServicePrincipal(MiniHiveKdc.HIVE_SERVICE_PRINCIPAL);
    String hiveKeytab = miniHiveKdc.getKeyTabFile(
        miniHiveKdc.getServicePrincipalForUser(MiniHiveKdc.HIVE_SERVICE_PRINCIPAL));

    return new MiniHS2.Builder().withConf(hiveConf).withRemoteMetastore().
        withMiniKdc(hivePrincipal, hiveKeytab).withAuthenticationType(authType).build();
  }
Create a MiniHS2 with the hive service principal and keytab in MiniHiveKdc. It uses remote HMS
and can support a different Sasl authType
@param miniHiveKdc
@param hiveConf
@param authType
@return new MiniHS2 instance
@throws Exception
itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/MiniHiveKdc.java