use of javax.servlet.http.HttpSession in project jodd by oblac.
the class SessionMonitor method sessionDestroyed.
/**
* Removes session from a map and broadcasts event to registered listeners.
*/
public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
HttpSession session = httpSessionEvent.getSession();
sessionMap.remove(session.getId());
for (HttpSessionListener listener : listeners) {
listener.sessionDestroyed(httpSessionEvent);
}
}
use of javax.servlet.http.HttpSession in project spark by perwendel.
the class SessionTest method setup.
@Before
public void setup() {
httpSession = mock(HttpSession.class);
request = mock(Request.class);
session = new Session(httpSession, request);
}
use of javax.servlet.http.HttpSession in project spark by perwendel.
the class SessionTest method testSession.
@Test
public void testSession() {
HttpSession internalSession = Whitebox.getInternalState(session, "session");
assertEquals("Internal session should be set to the http session provided during instantiation", httpSession, internalSession);
}
use of javax.servlet.http.HttpSession in project spark by perwendel.
the class RequestTest method testSession_2times.
@Test
public void testSession_2times() {
when(servletRequest.getSession(true)).thenReturn(httpSession);
Session session = request.session(true);
session = request.session(true);
assertNotNull(session);
verify(servletRequest, times(1)).getSession(true);
}
use of javax.servlet.http.HttpSession in project spark by perwendel.
the class RequestTest method setup.
@Before
public void setup() {
servletRequest = mock(HttpServletRequest.class);
httpSession = mock(HttpSession.class);
request = new Request(match, servletRequest);
}
Aggregations