mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 08:41:22 +00:00
This changes the way Quarkus ClassLoading works, to allow for isolated class loaders. It also unifies how Quarkus is launched, so every different mode we support uses the same mechanism for both curation and launch. Tests are now run in an isolated ClassLoader, which means that a proxy is created that runs the tests from within the isolated ClassLoader. This currently has a quirk where @BeforeAll methods are run twice, which will be fixed in the next JUnit release. This can be worked around by using @QuarkusBeforeAll.
JAX-RS example using Keycloak adapter to protect resources
Running the tests
By default, the tests of this module are disabled.
To run the tests in a standard JVM with Keycloak Server started as a Docker container, you can run the following command:
mvn clean install -Dtest-keycloak -Ddocker
Additionally, you can generate a native image and run the tests for this native image by adding -Dnative:
mvn clean install -Dtest-keycloak -Ddocker -Dnative
If you don't want to run Keycloak Server as a Docker container, you can start your own Keycloak server. It needs to listen on the default port 8180.
You can then run the tests as follows (either with -Dnative or not):
mvn clean install -Dtest-keycloak
If you have specific requirements, you can define a specific connection URL with -Dkeycloak.url=http://keycloak.server.domain:8180/auth.