### Question:
AuthenticationFilter extends ExcludingPatternFilter { protected RedirectUrl makeRedirectUrl(final HttpServletRequestAccessor httpRequest) { final RedirectUrlBuilder builder = new RedirectUrlBuilder(httpRequest.getRequestedUri()); builder.appendParameters(httpRequest.getParameterMap()); return builder.build(); } AuthenticationFilter(); String getDefaultExcludedPages(); @Override void proceedWithFiltering(final ServletRequest request, final ServletResponse response, final FilterChain chain); @Override void destroy();  }### Answer:
@Test public void testMakeRedirectUrl() throws Exception { when(request.getRequestedUri()).thenReturn("/portal/homepage"); final RedirectUrl redirectUrl = authenticationFilter.makeRedirectUrl(request); verify(request, times(1)).getRequestedUri(); assertThat(redirectUrl.getUrl()).isEqualToIgnoringCase("/portal/homepage"); }
@Test public void testMakeRedirectUrlFromRequestUrl() throws Exception { when(request.getRequestedUri()).thenReturn("portal/homepage"); when(httpRequest.getRequestURL()).thenReturn(new StringBuffer("http: final RedirectUrl redirectUrl = authenticationFilter.makeRedirectUrl(request); verify(request, times(1)).getRequestedUri(); verify(httpRequest, never()).getRequestURI(); assertThat(redirectUrl.getUrl()).isEqualToIgnoringCase("portal/homepage"); }