public void testUnknownUserReturnsNull() { HttpSession session = mock(HttpSession.class); when(session.getAttribute("user")).thenReturn(ParticipantId.ofUnsafe("missing@example.com")); assertNull(sessionManager.getLoggedInAccount(session)); }
public void testUnknownUserReturnsNull() { HttpSession session = mock(HttpSession.class); when(session.getAttribute("user")).thenReturn(ParticipantId.ofUnsafe("missing@example.com")); assertNull(sessionManager.getLoggedInAccount(session)); }
AccountData account = sessionManager.getLoggedInAccount(request.getSession(false)); if (account != null) { String locale = account.asHuman().getLocale();
public void testSessionFetchesAddress() { HttpSession session = mock(HttpSession.class); ParticipantId id = ParticipantId.ofUnsafe("tubes@example.com"); when(session.getAttribute("user")).thenReturn(id); assertEquals(id, sessionManager.getLoggedInUser(session)); assertSame(account, sessionManager.getLoggedInAccount(session)); }
public void testSessionFetchesAddress() { HttpSession session = mock(HttpSession.class); ParticipantId id = ParticipantId.ofUnsafe("tubes@example.com"); when(session.getAttribute("user")).thenReturn(id); assertEquals(id, sessionManager.getLoggedInUser(session)); assertSame(account, sessionManager.getLoggedInAccount(session)); }
public void testNullSessionReturnsNull() { assertNull(sessionManager.getLoggedInUser((HttpSession) null)); assertNull(sessionManager.getLoggedInAccount((HttpSession) null)); }
public void testNullSessionReturnsNull() { assertNull(sessionManager.getLoggedInUser(null)); assertNull(sessionManager.getLoggedInAccount(null)); }