@Test public void testGenerateSessionId() throws Exception { when(configuration.shouldGenerateSessionId()).thenReturn(true); final HttpSession session = Mockito.mock(HttpSession.class); when(httpServletRequest.getSession(any(Boolean.class))).thenReturn(session); when(session.getId()).thenReturn("A_RANDOM_SESSION_ID"); unit.requestInitialized(wrapToEvent(httpServletRequest)); verify(backend, atLeastOnce()).put(eq(SESSION_ID_KEY), anyString()); }
@Override public void requestInitialized(final ServletRequestEvent sre) { final ServletRequest servletRequest = sre.getServletRequest(); if (servletRequest instanceof HttpServletRequest) { httpRequestInitialized((HttpServletRequest) servletRequest); } }
TraceeServletRequestListener implements ServletRequestListener { @Override public void requestInitialized(final ServletRequestEvent sre) { final ServletRequest servletRequest = sre.getServletRequest(); if (servletRequest instanceof HttpServletRequest) { httpRequestInitialized((HttpServletRequest) servletRequest); } } }
TraceeServletRequestListener implements ServletRequestListener { @Override public void requestInitialized(final ServletRequestEvent sre) { final ServletRequest servletRequest = sre.getServletRequest(); if (servletRequest instanceof HttpServletRequest) { httpRequestInitialized((HttpServletRequest) servletRequest); } } protected  TraceeServletRequestListener(TraceeBackend backend, HttpHeaderTransport transportSerialization);  TraceeServletRequestListener(); }
TraceeServletRequestListener implements ServletRequestListener { @Override public void requestInitialized(final ServletRequestEvent sre) { final ServletRequest servletRequest = sre.getServletRequest(); if (servletRequest instanceof HttpServletRequest) { httpRequestInitialized((HttpServletRequest) servletRequest); } } protected  TraceeServletRequestListener(TraceeBackend backend, HttpHeaderTransport transportSerialization);  TraceeServletRequestListener(); @Override void requestDestroyed(final ServletRequestEvent sre); @Override void requestInitialized(final ServletRequestEvent sre); }
TraceeServletRequestListener implements ServletRequestListener { @Override public void requestInitialized(final ServletRequestEvent sre) { final ServletRequest servletRequest = sre.getServletRequest(); if (servletRequest instanceof HttpServletRequest) { httpRequestInitialized((HttpServletRequest) servletRequest); } } protected  TraceeServletRequestListener(TraceeBackend backend, HttpHeaderTransport transportSerialization);  TraceeServletRequestListener(); @Override void requestDestroyed(final ServletRequestEvent sre); @Override void requestInitialized(final ServletRequestEvent sre);  }