public void testServletRedirects() throws Exception { String redirect_location = "/abc123?nested=query&string"; when(req.getParameter("r")).thenReturn(redirect_location); servlet.doGet(req, resp); verify(resp).sendRedirect(redirect_location); }
public void testServletWorksWhenSessionIsMissing() throws Exception { when(req.getSession(false)).thenReturn(null); servlet.doGet(req, resp); verify(resp).setStatus(HttpServletResponse.SC_OK); } }
public void testServletDoesNotRedirectToRemoteUrl() throws Exception { String redirect_location = "http://example.com/"; when(req.getParameter("r")).thenReturn(redirect_location); servlet.doGet(req, resp); verify(resp, never()).sendRedirect(anyString()); }
public void testServletRedirects() throws Exception { String redirect_location = "/abc123?nested=query&string"; when(req.getParameter("r")).thenReturn(redirect_location); servlet.doGet(req, resp); verify(resp).sendRedirect(redirect_location); }
public void testServletWorksWhenSessionIsMissing() throws Exception { when(req.getSession(false)).thenReturn(null); servlet.doGet(req, resp); verify(resp).setStatus(HttpServletResponse.SC_OK); } }
public void testServletDoesNotRedirectToRemoteUrl() throws Exception { String redirect_location = "http://example.com/"; when(req.getParameter("r")).thenReturn(redirect_location); servlet.doGet(req, resp); verify(resp, never()).sendRedirect(anyString()); }
public void testUserSignedOut() throws Exception { servlet.doGet(req, resp); verify(sessionManager).logout(session); verify(resp).setStatus(HttpServletResponse.SC_OK); }
public void testUserSignedOut() throws Exception { servlet.doGet(req, resp); verify(sessionManager).logout(session); verify(resp).setStatus(HttpServletResponse.SC_OK); }