mirror of
https://github.com/keycloak/keycloak.git
synced 2026-10-23 19:29:23 +03:00
Previously, a RealmConfigInterceptor applied to every realm created within a test class, and it couldn't distinguish which realm it is decorating. AbstractInterceptorHelper contains now an applies(..) filter that defaults to true, and Interception exposes the interceptor annotation, which is available whether or not the interceptor has been deployed. An interception that does not apply is skipped before it is applied, logged, or registered as a dependent of the intercepted instance. RealmConfigInterceptor exposes this as appliesTo(..). Existing interceptors inherit the default and keep applying to every realm. Closes #51751 Closes #51752 Signed-off-by: Bernhard Strähle <bernhard.straehle@gmail.com>
Keycloak Test Framework
The Keycloak JUnit test framework makes it easy to write tests for Keycloak and extensions. Behind the scenes the framework handles the lifecycle of Keycloak, the database, and any injected resources such as realms and clients.
Tests simply declare what they want, including specific configuration, and the framework takes care of the rest.
Chapters
- Getting started - Quick start for using the test framework
- Configuring - Overview of how to configure the test framework
- Writing tests - How to write tests
- Running tests - How to run tests using different configuration options
- Configuring logging - How to configure logging when running tests
- Using test suites - How to use tests suites with custom configuration
- Best practices - Best practices and common pitfalls
- Debugging - Debugging Keycloak and extensions
- Writing extensions - Writing test framework extensions
- GitHub Actions - Support for creating job summary on GitHub Actions