private void verify(String authTypes, HiveServer2TransportMode mode, boolean shouldThrowException) {
    try {
      AuthType authType = new AuthType(authTypes, mode);
      if (shouldThrowException) {
        Assert.fail("HiveServer2 " + mode.name() + " mode cann't support " + authTypes + " by design");
      } else {
        String[] authMethods = authTypes.split(",");
        for (int i = 0; i < authMethods.length; i++) {
          HiveAuthConstants.AuthTypes authMech = EnumUtils.getEnumIgnoreCase(HiveAuthConstants.AuthTypes.class,
              authMethods[i]);
          Assert.assertTrue(authType.isEnabled(authMech));
        }
      }
    } catch (Exception e) {
      if (!shouldThrowException) {
        Assert.fail("HiveServer2 " + mode.name() + " mode should be able to support " + authTypes);
      } else {
        Assert.assertTrue(e instanceof RuntimeException);
      }
    }
  }
Tests to test if AuthType can parse allowed values and reject disallowed combinations.
service/src/test/org/apache/hive/service/auth/TestAuthType.java