@Test
public void testKerberosAuthenticationEnabled() throws IOException {

  File keytabFile = temp.newFile("spnego.service.keytab");
  Properties properties = new Properties();
  properties.put(Configuration.KERBEROS_AUTH_ENABLED.getKey(), "true");
  properties.put(Configuration.KERBEROS_AUTH_SPNEGO_KEYTAB_FILE.getKey(), keytabFile.getAbsolutePath());
  properties.put(Configuration.KERBEROS_AUTH_SPNEGO_PRINCIPAL.getKey(), "spnego/principal@REALM");
  properties.put(Configuration.KERBEROS_AUTH_USER_TYPES.getKey(), "LDAP, LOCAL");
  properties.put(Configuration.KERBEROS_AUTH_AUTH_TO_LOCAL_RULES.getKey(), "DEFAULT");
  Configuration configuration = new Configuration(properties);
  AmbariKerberosAuthenticationProperties kerberosAuthenticationProperties = configuration.getKerberosAuthenticationProperties();
  Assert.assertTrue(kerberosAuthenticationProperties.isKerberosAuthenticationEnabled());
  Assert.assertEquals(keytabFile.getAbsolutePath(), kerberosAuthenticationProperties.getSpnegoKeytabFilePath());
  Assert.assertEquals("spnego/principal@REALM", kerberosAuthenticationProperties.getSpnegoPrincipalName());
  Assert.assertEquals("DEFAULT", kerberosAuthenticationProperties.getAuthToLocalRules());
  Assert.assertEquals(Arrays.asList(UserType.LDAP, UserType.LOCAL), kerberosAuthenticationProperties.getOrderedUserTypes());
}