### Question:
AuthFilter extends AuthenticationFilter { @Override protected Properties getConfiguration(String prefix, FilterConfig config) throws ServletException { final Properties p = super.getConfiguration(CONF_PREFIX, config); p.setProperty(AUTH_TYPE, UserGroupInformation.isSecurityEnabled()? KerberosAuthenticationHandler.TYPE: PseudoAuthenticationHandler.TYPE); p.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, "true"); p.setProperty(COOKIE_PATH, "/"); return p; }  @Override void doFilter(ServletRequest request, ServletResponse response,
      FilterChain filterChain);  }### Answer:
@Test public void testGetConfiguration() throws ServletException { AuthFilter filter = new AuthFilter(); Map<String, String> m = new HashMap<String,String>(); m.put(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_PRINCIPAL_KEY, "xyz/thehost@REALM"); m.put(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY, "thekeytab"); FilterConfig config = new DummyFilterConfig(m); Properties p = filter.getConfiguration("random", config); Assert.assertEquals("xyz/thehost@REALM", p.getProperty("kerberos.principal")); Assert.assertEquals("thekeytab", p.getProperty("kerberos.keytab")); Assert.assertEquals("true", p.getProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED)); }