public void testLoginRedirects() throws IOException { String redirect = "/abc123?nested=query&string"; configureRedirectString(redirect); attemptLogin("frodo@example.com", "password", true); verify(resp).sendRedirect(redirect); }
public void testLoginDoesNotRedirectToRemoteSite() throws IOException { configureRedirectString("http://example.com/other/site"); attemptLogin("frodo@example.com", "password", true); verify(resp, never()).sendRedirect(anyString()); }
public void testLoginRedirects() throws IOException { String redirect = "/abc123?nested=query&string"; configureRedirectString(redirect); attemptLogin("frodo@example.com", "password", true); verify(resp).sendRedirect(redirect); }
public void testLoginDoesNotRedirectToRemoteSite() throws IOException { configureRedirectString("http://example.com/other/site"); attemptLogin("frodo@example.com", "password", true); verify(resp, never()).sendRedirect(anyString()); }
public void testUserWithNoDomainReturnAddress() throws Exception { configureRedirectString("none"); attemptLogin("frodo@example.com", "password", true); verify(resp.getWriter()).write( "{ \"participantId\" : \"" + "frodo@example.com" + "\", " + " \"sessionId\" : \"" + "" + "\" }"); }
public void testGetRedirects() throws IOException { String location = "/abc123?nested=query&string"; when(req.getSession(false)).thenReturn(session); when(manager.getLoggedInUser(session)).thenReturn(USER); configureRedirectString(location); servlet.doGet(req, resp); verify(resp).sendRedirect(location); }
public void testGetRedirects() throws IOException { String location = "/abc123?nested=query&string"; when(req.getSession(eq(false))).thenReturn(session); when(manager.getLoggedInUser(eq(session))).thenReturn(USER); when(manager.getLoggedInUser(eq(req))).thenReturn(USER); configureRedirectString(location); servlet.doGet(req, resp); verify(resp).sendRedirect(location); }