public void testUserWithNoDomainGetsDomainAutomaticallyAdded() throws Exception { attemptLogin("frodo@example.com", "password", true); verify(resp).sendRedirect("/"); }
public void testValidLoginWorks() throws IOException { attemptLogin("frodo@example.com", "password", true); verify(resp).sendRedirect("/"); }
public void testValidLoginWorks() throws IOException { attemptLogin("frodo@example.com", "password", true); verify(resp).sendRedirect("/"); }
public void testUserWithNoDomainGetsDomainAutomaticallyAdded() throws Exception { attemptLogin("frodo", "password", true); verify(resp).sendRedirect("/"); }
public void testIncorrectPasswordReturns403() throws IOException { attemptLogin("frodo@example.com", "incorrect", false); verify(resp).setStatus(HttpServletResponse.SC_FORBIDDEN); verify(session, never()).setAttribute(eq("user"), anyString()); }
public void testInvalidUsernameReturns403() throws IOException { attemptLogin("madeup@example.com", "incorrect", false); verify(resp).setStatus(HttpServletResponse.SC_FORBIDDEN); verify(session, never()).setAttribute(eq("address"), anyString()); }
public void testInvalidUsernameReturns403() throws IOException { attemptLogin("madeup@example.com", "incorrect", false); verify(resp).setStatus(HttpServletResponse.SC_FORBIDDEN); verify(session, never()).setAttribute(eq("address"), anyString()); }
public void testIncorrectPasswordReturns403() throws IOException { attemptLogin("frodo@example.com", "incorrect", false); verify(resp).setStatus(HttpServletResponse.SC_FORBIDDEN); verify(session, never()).setAttribute(eq("user"), 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 testUserWithNoDomainReturnAddress() throws Exception { configureRedirectString("none"); attemptLogin("frodo@example.com", "password", true); verify(resp.getWriter()).write( "{ \"participantId\" : \"" + "frodo@example.com" + "\", " + " \"sessionId\" : \"" + "" + "\" }"); }
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 testAnonymousLogin() throws IOException { attemptLogin(ANONYMOUS_USER.getAddress(), "", true); }
public void testLoginDoesNotRedirectToRemoteSite() throws IOException { configureRedirectString("http://example.com/other/site"); attemptLogin("frodo@example.com", "password", true); verify(resp, never()).sendRedirect(anyString()); }