@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());
  }
Tests that the Kerberos-authentication properties are read and properly and set in an
{@link AmbariKerberosAuthenticationProperties} instance when Kerberos authentication is enabled
and default values are expected to be used for unset properties.
ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java