Package org.pac4j.testkit
Class FormScenarios
java.lang.Object
org.pac4j.testkit.FormScenarios
Pre-assembled HTTP test scenarios for form-based authentication.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidrunBadCredentials(String serverUrl) POST /login with wrong password -> redirect to /login?errorstatic voidrunHappyPath(String serverUrl) POST /login with valid credentials, follow redirect to /protected -> 200static voidPOST /logout invalidates session -> /protected redirects to /loginstatic voidrunLogoutWithCustomRedirect(String serverUrl) POST /logout -> redirects to configured post-logout URL.static voidrunRedirectAfterLoginToRequestedUrl(String serverUrl) GET /protected/admin without session -> redirect to /login.static voidrunRedirectWhenUnauthenticated(String serverUrl) GET /protected with no session -> redirect to /login
-
Method Details
-
runHappyPath
POST /login with valid credentials, follow redirect to /protected -> 200- Throws:
IOException
-
runBadCredentials
POST /login with wrong password -> redirect to /login?error- Throws:
IOException
-
runRedirectAfterLoginToRequestedUrl
GET /protected/admin without session -> redirect to /login. POST /login -> redirect back to originally requested /protected/admin (not just /protected).- Throws:
IOException
-
runRedirectWhenUnauthenticated
GET /protected with no session -> redirect to /login- Throws:
IOException
-
runLogout
POST /logout invalidates session -> /protected redirects to /login- Throws:
IOException
-
runLogoutWithCustomRedirect
POST /logout -> redirects to configured post-logout URL. After logout, /protected is inaccessible.- Throws:
IOException
-