@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"));
}