### Question:
AuthenticationFilter extends ExcludingPatternFilter { protected void redirectTo(final HttpServletRequestAccessor request, final HttpServletResponse response, final long tenantId, final String pagePath) throws ServletException { try { response.sendRedirect(request.asHttpServletRequest().getContextPath() + pagePath); } catch (final IOException e) { if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, e.getMessage()); } } } AuthenticationFilter(); String getDefaultExcludedPages(); @Override void proceedWithFiltering(final ServletRequest request, final ServletResponse response, final FilterChain chain); @Override void destroy();  }### Answer:
@Test public void testRedirectTo() throws Exception { final String context = "/bonita"; when(httpRequest.getContextPath()).thenReturn(context); final long tenantId = 0L; authenticationFilter.redirectTo(request, httpResponse, tenantId, AuthenticationFilter.MAINTENANCE_JSP); verify(httpResponse, times(1)).sendRedirect(context + AuthenticationFilter.MAINTENANCE_JSP); verify(httpRequest, times(1)).getContextPath(); }