private void testSingleAuth(HiveAuthConstants.AuthTypes type) throws Exception {
    AuthType authType = new AuthType(type.getAuthName(), HiveServer2TransportMode.http);
    Assert.assertTrue(authType.isEnabled(type));
    if (type == HiveAuthConstants.AuthTypes.NOSASL || type == HiveAuthConstants.AuthTypes.NONE ||
        AuthType.PASSWORD_BASED_TYPES.contains(type)) {
      Assert.assertEquals(type.getAuthName(), authType.getPasswordBasedAuthStr());
    } else {
      Assert.assertEquals("Should return empty string if no password based authentication is set.",
          "", authType.getPasswordBasedAuthStr());
    }
  }
Tests to test if AuthType can parse allowed values and reject disallowed combinations.
service/src/test/org/apache/hive/service/auth/TestAuthType.java