@Test
public void testOnAuthenticationSuccess_SetNullRedirectToRedirectStrategyAndSetContextRelative() throws Exception {

    RedirectAuthenticationHandler redireHandler = new RedirectAuthenticationHandler();
    DefaultRedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
    redirectStrategy.setContextRelative(true);
    redireHandler.setRedirectStrategy(redirectStrategy);
    // set Blank URI
    String redirectURI = "http://localhost/foo/bar";
    request.setParameter("redirectTo", redirectURI);
    // expected data
    String expectedRedirectURL = "bar";
    // run
    redireHandler.onAuthenticationSuccess(request, response, auth);
    // assert
    assertThat(response.getRedirectedUrl(), is(expectedRedirectURL));
}