test_class.file: session-replacement/src/test/java/com/amadeus/session/servlet/TestInitializeSessionManagement.java
test_class.identifier: TestInitializeSessionManagement
test_case.body: @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"));
    }
test_case.class_method_signature: TestInitializeSessionManagement.testWithProviders()
test_case.full_signature: @Test public void testWithProviders()
test_case.identifier: testWithProviders
test_case.invocations: mock mock thenReturn when addFilter any any thenReturn when getClassLoader getClassLoader getClass onStartup forClass setAttribute verify eq capture assertTrue containsKey getValue assertEquals getName get getValue assertTrue containsKey getValue assertEquals getName get getValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWithProviders()
focal_class.declarator: logger = LoggerFactory.getLogger(InitializeSessionManagement.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(InitializeSessionManagement.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: disabled = Boolean.parseBoolean(getPropertySecured(DISABLED_SESSION, null))
focal_class.modifier: private static
focal_class.original_string: private static boolean disabled = Boolean.parseBoolean(getPropertySecured(DISABLED_SESSION, null));
focal_class.type: boolean
focal_class.var_name: disabled
focal_class.file: session-replacement/src/main/java/com/amadeus/session/servlet/InitializeSessionManagement.java
focal_class.identifier: InitializeSessionManagement
focal_class.interfaces: implements ServletContainerInitializer
focal_class.class_method_signature: InitializeSessionManagement.onStartup(Set<Class<?>> classes, ServletContext context)
focal_class.full_signature: @Override public void onStartup(Set<Class<?>> classes, ServletContext context)
focal_class.identifier: onStartup
focal_class.modifiers: @Override public
focal_class.parameters: (Set<Class<?>> classes, ServletContext context)
focal_class.return: void
focal_class.signature: void onStartup(Set<Class<?>> classes, ServletContext context)
focal_class.class_method_signature: InitializeSessionManagement.setupProviders(ServletContext context)
focal_class.full_signature: static void setupProviders(ServletContext context)
focal_class.identifier: setupProviders
focal_class.modifiers: static
focal_class.parameters: (ServletContext context)
focal_class.return: void
focal_class.signature: void setupProviders(ServletContext context)
focal_method.body: @Override
    public void onStartup(Set<Class<?>> classes, ServletContext context) throws ServletException {
      // If session support is disabled, just log it
      if (disabled || Boolean.parseBoolean(context.getInitParameter(DISABLED_SESSION))) {
        logger.warn("Session management disabled for {}, {}, {}", context.getContextPath(), disabled,
            context.getInitParameter(DISABLED_SESSION));
        return;
      }
      setupProviders(context);
      initSessionManagement(context);
    }
focal_method.class_method_signature: InitializeSessionManagement.onStartup(Set<Class<?>> classes, ServletContext context)
focal_method.full_signature: @Override public void onStartup(Set<Class<?>> classes, ServletContext context)
focal_method.identifier: onStartup
focal_method.invocations: parseBoolean getInitParameter warn getContextPath getInitParameter setupProviders initSessionManagement
focal_method.modifiers: @Override public
focal_method.parameters: (Set<Class<?>> classes, ServletContext context)
focal_method.return: void
focal_method.signature: void onStartup(Set<Class<?>> classes, ServletContext context)