@Test void testCommencePreflight() throws Exception { HttpServletRequest request = mock(HttpServletRequest.class); when(request.getMethod()).thenReturn(OPTIONS.toString()).getMock(); HttpServletResponse response = mock(HttpServletResponse.class); AuthenticationException authException = mock(AuthenticationException.class); ajaxAwareLoginUrlAuthenticationEntryPoint.commence(request, response, authException); verify(response).setStatus(HttpServletResponse.SC_NO_CONTENT); }
@Override public void commence( final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException) throws IOException, ServletException { if (isPreflight(request)) { response.setStatus(HttpServletResponse.SC_NO_CONTENT); } else if (isRestRequest(request)) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { super.commence(request, response, authException); } }
AjaxAwareLoginUrlAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint { @Override public void commence( final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException) throws IOException, ServletException { if (isPreflight(request)) { response.setStatus(HttpServletResponse.SC_NO_CONTENT); } else if (isRestRequest(request)) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { super.commence(request, response, authException); } } }
AjaxAwareLoginUrlAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint { @Override public void commence( final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException) throws IOException, ServletException { if (isPreflight(request)) { response.setStatus(HttpServletResponse.SC_NO_CONTENT); } else if (isRestRequest(request)) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { super.commence(request, response, authException); } } AjaxAwareLoginUrlAuthenticationEntryPoint(String loginFormUrl); }
AjaxAwareLoginUrlAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint { @Override public void commence( final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException) throws IOException, ServletException { if (isPreflight(request)) { response.setStatus(HttpServletResponse.SC_NO_CONTENT); } else if (isRestRequest(request)) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { super.commence(request, response, authException); } } AjaxAwareLoginUrlAuthenticationEntryPoint(String loginFormUrl); @Override void commence(
      final HttpServletRequest request,
      final HttpServletResponse response,
      final AuthenticationException authException); }
AjaxAwareLoginUrlAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint { @Override public void commence( final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException) throws IOException, ServletException { if (isPreflight(request)) { response.setStatus(HttpServletResponse.SC_NO_CONTENT); } else if (isRestRequest(request)) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { super.commence(request, response, authException); } } AjaxAwareLoginUrlAuthenticationEntryPoint(String loginFormUrl); @Override void commence(
      final HttpServletRequest request,
      final HttpServletResponse response,
      final AuthenticationException authException);  }