# Introducing the Keycloak Test Framework

DevFeed: [Introducing the Keycloak Test Framework](<https://devfeed.tech/articles/introducing-the-keycloak-test-framework-31673.md>)

Original publisher: [Read original article](<https://www.keycloak.org/2024/11/preview-keycloak-test-framework>)

Author: Lukas Hanusovsky

Published: 2024-11-14T00:00:00Z

Content type: release

Language: en

Sources: [Keycloak Blog](<https://devfeed.tech/sources/keycloak-blog.md>)

Topics: [Keycloak](<https://devfeed.tech/topics/keycloak.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [OAuth](<https://devfeed.tech/topics/oauth.md>), [browsers](<https://devfeed.tech/topics/browsers.md>), [Chrome](<https://devfeed.tech/topics/chrome.md>), [Firefox](<https://devfeed.tech/topics/firefox.md>), [SDK](<https://devfeed.tech/topics/sdk.md>)

Tags: [browsers](<https://devfeed.tech/tags/browsers.md>), [chrome](<https://devfeed.tech/tags/chrome.md>), [firefox](<https://devfeed.tech/tags/firefox.md>), [framework](<https://devfeed.tech/tags/framework.md>), [guide](<https://devfeed.tech/tags/guide.md>), [idm](<https://devfeed.tech/tags/idm.md>), [kerberos](<https://devfeed.tech/tags/kerberos.md>), [keycloak](<https://devfeed.tech/tags/keycloak.md>), [ldap](<https://devfeed.tech/tags/ldap.md>), [maven](<https://devfeed.tech/tags/maven.md>), [oauth](<https://devfeed.tech/tags/oauth.md>), [openid-connect](<https://devfeed.tech/tags/openid-connect.md>), [saml](<https://devfeed.tech/tags/saml.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [sso](<https://devfeed.tech/tags/sso.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

Keycloak introduces a new test framework designed to replace its current Arquillian-based test suite. The JUnit 5 extension supports custom injection, server and database lifecycles, clients and users, OAuth, UI testing, WebDriver integration, and multiple browsers. The framework is available in the main branch and nightly builds, with migration from the old testsuite beginning.

## Source excerpt

How It All Started The idea to replace the current test suite has been on the table for multiple years. Initially, it was meant to be only a refactoring of the current approach on how to write tests, but after a few internal discussions and refactor updates it turned out a new test suite, based on a new framework would be a better solution. It would be good to mention a few drawbacks, that stand out when working with the current test suite. First of all, is the complexity of various configurations and additions made on top of the Arquillian framework. These changes make the test suite powerful, but the cons is that without proper documentation for beginners is almost unreadable. The second thing has the same importance, the Arquillian framework is not fully supported anymore. Other things to mention are a complicated execution system, where you want to specify what exactly should be tested, then abstract classes with shared configurations and missing the option to add a custom extension. Brighter Future? The Keycloak team began an effort to design a new test framework in May 2024. It started with a prototype to verify if our ideas were feasible. The prototype is a JUnit5 Extension based on the JUnit5 testing framework, specifically to implement JUnit5 callback classes which extend the default test lifecycle functionality and provide custom inject annotations, like @KeycloakIntegrationTest, @InjectWebDriver or @InjectRealm. After a successful test round, we've continued with a proof of concept extending features list to support multiple server modes, different databases and WebDrivers, clients and users setup, SmallRye configuration support, OAuthClient based on Nimbus SDK (this feature is a preview only) etc. The full list of currently implemented features is: Maven BOM Core module Server lifecycle Database lifecycle Admin client injection Realm, User, Client lifecycle and injection Event and Admin event listener and injection OAuth client injection UI module WebDri