public void testGetReturnsSomething() throws IOException { when(req.getSession(false)).thenReturn(null); PrintWriter writer = mock(PrintWriter.class); when(resp.getWriter()).thenReturn(writer); when(req.getLocale()).thenReturn(Locale.ENGLISH); servlet.doGet(req, resp); verify(resp).setStatus(HttpServletResponse.SC_OK); }
public void testGetReturnsSomething() throws IOException { when(req.getSession(eq(false))).thenReturn(null); PrintWriter writer = mock(PrintWriter.class); when(resp.getWriter()).thenReturn(writer); when(req.getLocale()).thenReturn(Locale.ENGLISH); servlet.doGet(req, resp); verify(resp).setStatus(HttpServletResponse.SC_OK); }
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); }
failedClientAuth = true; skipClientAuth = true; doGet(req, resp);