@Test
public void testKerberosAuthenticationEnabledUsingDefaults() throws IOException {

  File keytabFile = temp.newFile("spnego.service.keytab");
  Properties properties = new Properties();
  properties.put(Configuration.KERBEROS_AUTH_ENABLED.getKey(), "true");
  // Force a specific path to the SPNEGO keytab file since internal validation expects to exist
  properties.put(Configuration.KERBEROS_AUTH_SPNEGO_KEYTAB_FILE.getKey(), keytabFile.getAbsolutePath());
  Configuration configuration = new Configuration(properties);
  AmbariKerberosAuthenticationProperties kerberosAuthenticationProperties = configuration.getKerberosAuthenticationProperties();
  Assert.assertTrue(kerberosAuthenticationProperties.isKerberosAuthenticationEnabled());
  Assert.assertEquals(keytabFile.getAbsolutePath(), kerberosAuthenticationProperties.getSpnegoKeytabFilePath());
  Assert.assertEquals("HTTP/" + StageUtils.getHostName(), kerberosAuthenticationProperties.getSpnegoPrincipalName());
  Assert.assertEquals("DEFAULT", kerberosAuthenticationProperties.getAuthToLocalRules());
  Assert.assertEquals(Collections.singletonList(UserType.LDAP), kerberosAuthenticationProperties.getOrderedUserTypes());
}