@Test void testCommenceOther() throws Exception { HttpServletRequest request = mock(HttpServletRequest.class); when(request.getScheme()).thenReturn("http"); when(request.getServerName()).thenReturn("molgenis.org"); when(request.getServerPort()).thenReturn(80); HttpServletResponse response = mock(HttpServletResponse.class); when(response.encodeRedirectURL("http: .thenReturn("http: AuthenticationException authException = mock(AuthenticationException.class); ajaxAwareLoginUrlAuthenticationEntryPoint.commence(request, response, authException); verify(response).sendRedirect("http: }
@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);  }