@Test public void testOnLogoutSuccessNullAuthentication() throws IOException, ServletException { ajaxLogoutSuccessHandler.onLogoutSuccess(request, response, null); verify(request, never()).getSession(); verify(httpSession, never()).invalidate(); verify(response, never()).setStatus(HttpServletResponse.SC_OK); verify(response, never()).setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); verifyZeroInteractions(request, response); }
@Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { if (authentication != null && authentication.getDetails() != null) { try { headerHandler.process(request, response); request.getSession().invalidate(); response.setStatus(HttpServletResponse.SC_OK); } catch (Exception e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }
AjaxLogoutSuccessHandler extends AbstractAuthenticationTargetUrlRequestHandler implements LogoutSuccessHandler { @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { if (authentication != null && authentication.getDetails() != null) { try { headerHandler.process(request, response); request.getSession().invalidate(); response.setStatus(HttpServletResponse.SC_OK); } catch (Exception e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } } }
AjaxLogoutSuccessHandler extends AbstractAuthenticationTargetUrlRequestHandler implements LogoutSuccessHandler { @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { if (authentication != null && authentication.getDetails() != null) { try { headerHandler.process(request, response); request.getSession().invalidate(); response.setStatus(HttpServletResponse.SC_OK); } catch (Exception e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }  }
AjaxLogoutSuccessHandler extends AbstractAuthenticationTargetUrlRequestHandler implements LogoutSuccessHandler { @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { if (authentication != null && authentication.getDetails() != null) { try { headerHandler.process(request, response); request.getSession().invalidate(); response.setStatus(HttpServletResponse.SC_OK); } catch (Exception e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }  @Override void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication); }
AjaxLogoutSuccessHandler extends AbstractAuthenticationTargetUrlRequestHandler implements LogoutSuccessHandler { @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { if (authentication != null && authentication.getDetails() != null) { try { headerHandler.process(request, response); request.getSession().invalidate(); response.setStatus(HttpServletResponse.SC_OK); } catch (Exception e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }  @Override void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication);  }