@Test
public void testWithProviders() throws ServletException {

  InitializeSessionManagement ism = new InitializeSessionManagement();
  ServletContext context = mock(ServletContext.class);
  Dynamic dynamic = mock(Dynamic.class);
  when(context.addFilter(any(String.class), any(Filter.class))).thenReturn(dynamic);
  when(context.getClassLoader()).thenReturn(this.getClass().getClassLoader());
  ism.onStartup(null, context);
  @SuppressWarnings("rawtypes")
  ArgumentCaptor<HashMap> arg = ArgumentCaptor.forClass(HashMap.class);
  verify(context).setAttribute(eq(PROVIDERS), arg.capture());
  assertTrue(arg.getValue().containsKey("redis"));
  assertEquals(JedisSessionRepositoryFactory.class.getName(), arg.getValue().get("redis"));
  assertTrue(arg.getValue().containsKey("in-memory"));
  assertEquals(InMemoryRepositoryFactory.class.getName(), arg.getValue().get("in-memory"));
}