@Test public void testGetConfiguration() throws Exception { AuthenticationFilter filter = new AuthenticationFilter(); FilterConfig config = Mockito.mock(FilterConfig.class); Mockito.when(config.getInitParameter(AuthenticationFilter.CONFIG_PREFIX)).thenReturn(""); Mockito.when(config.getInitParameter("a")).thenReturn("A"); Mockito.when(config.getInitParameterNames()).thenReturn(new Vector<String>(Arrays.asList("a")).elements()); Properties props = filter.getConfiguration("", config); Assert.assertEquals("A", props.getProperty("a")); config = Mockito.mock(FilterConfig.class); Mockito.when(config.getInitParameter(AuthenticationFilter.CONFIG_PREFIX)).thenReturn("foo"); Mockito.when(config.getInitParameter("foo.a")).thenReturn("A"); Mockito.when(config.getInitParameterNames()).thenReturn(new Vector<String>(Arrays.asList("foo.a")).elements()); props = filter.getConfiguration("foo.", config); Assert.assertEquals("A", props.getProperty("a")); }
protected Properties getConfiguration() { return config; }
AuthenticationFilter implements Filter { protected Properties getConfiguration() { return config; } }
AuthenticationFilter implements Filter { protected Properties getConfiguration() { return config; }  }
AuthenticationFilter implements Filter { protected Properties getConfiguration() { return config; }  @Override void init(FilterConfig filterConfig); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain); static void createAuthCookie(HttpServletResponse resp, String token,
                                      String domain, String path, long expires,
                                      boolean isSecure); }
AuthenticationFilter implements Filter { protected Properties getConfiguration() { return config; }  @Override void init(FilterConfig filterConfig); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain); static void createAuthCookie(HttpServletResponse resp, String token,
                                      String domain, String path, long expires,
                                      boolean isSecure); static final String CONFIG_PREFIX; static final String AUTH_TYPE; static final String SIGNATURE_SECRET; static final String AUTH_TOKEN_VALIDITY; static final String COOKIE_DOMAIN; static final String COOKIE_PATH; static final String SIGNER_SECRET_PROVIDER; static final String SIGNER_SECRET_PROVIDER_ATTRIBUTE; }