AltKerberosAuthenticationHandler extends KerberosAuthenticationHandler { @Override public void init(Properties config) throws ServletException { super.init(config); nonBrowserUserAgents = config.getProperty( NON_BROWSER_USER_AGENTS, NON_BROWSER_USER_AGENTS_DEFAULT) .split("\\W*,\\W*"); for (int i = 0; i < nonBrowserUserAgents.length; i++) { nonBrowserUserAgents[i] = nonBrowserUserAgents[i].toLowerCase(Locale.ENGLISH); } }  @Override String getType(); @Override void init(Properties config); @Override AuthenticationToken authenticate(HttpServletRequest request,
      HttpServletResponse response); abstract AuthenticationToken alternateAuthenticate(
      HttpServletRequest request, HttpServletResponse response); static final String TYPE; static final String NON_BROWSER_USER_AGENTS; }
@Test(timeout=60000) public void testNonDefaultNonBrowserUserAgentAsNonBrowser() throws Exception { if (handler != null) { handler.destroy(); handler = null; } handler = getNewAuthenticationHandler(); Properties props = getDefaultProperties(); props.setProperty("alt-kerberos.non-browser.user-agents", "foo, bar"); try { handler.init(props); } catch (Exception ex) { handler = null; throw ex; } testRequestWithoutAuthorization(); testRequestWithInvalidAuthorization(); testRequestWithAuthorization(); testRequestWithInvalidKerberosAuthorization(); }