  @Test
  public void testAllowConnectOnKerberosPrincipal() {

    //Test with ruleset not set
    String validPrincipal = "hive@GCE.CLOUDERA.COM";
    assertTrue("Authenticate valid user", callBack.allowConnect(validPrincipal));

    String invalidPrincipal = "impala@GCE.CLOUDERA.COM";
    assertFalse("Do not authenticate invalid user", callBack.allowConnect(invalidPrincipal));

    //Test with ruleset set to DEFAULT
    String ruleString = "DEFAULT";
    KerberosName.setRules(ruleString);

    assertTrue("Authenticate valid user", callBack.allowConnect(validPrincipal));
    assertFalse("Do not authenticate invalid user", callBack.allowConnect(invalidPrincipal));
  }