Class FormScenarios

java.lang.Object
org.pac4j.testkit.FormScenarios

public final class FormScenarios extends Object
Pre-assembled HTTP test scenarios for form-based authentication.
  • Method Details

    • runHappyPath

      public static void runHappyPath(String serverUrl) throws IOException
      POST /login with valid credentials, follow redirect to /protected -> 200
      Throws:
      IOException
    • runBadCredentials

      public static void runBadCredentials(String serverUrl) throws IOException
      POST /login with wrong password -> redirect to /login?error
      Throws:
      IOException
    • runRedirectWhenUnauthenticated

      public static void runRedirectWhenUnauthenticated(String serverUrl) throws IOException
      GET /protected with no session -> redirect to /login
      Throws:
      IOException