Add KeycloakTestResourceLifecycleManager
See original GitHub issueDescription
In many OIDC related tests we have to add QuarkusTestResourceLifecycleManager
implementations which setup Keycloak - realm, client, users.
@stuartwdouglas has proposed that we provide the one which can be reused in tests, which is a nice idea.
Implementation ideas
Users who would like to test quarkus-oidc
against Keycloak should be able to type something like this:
@QuarkusTest
@QuarkusTestResource(TestKeycloakRealmResourceManager.class)
public class CodeFlowTest {
@Test
public void testCodeFlow() throws IOException {
}
}
where TestKeycloakRealmResourceManager.class
would by default set up quarkus
realm, quarkus-app
client, users alice
as admin
and bob
as user
, something like that, and possibly be configurable
@cemnura let me know please if it can be of interest once the wiremock issues are complete 😃
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Server Developer Guide - Keycloak
To deploy a theme as an archive, create a JAR archive with the theme resources. Add a file META-INF/keycloak-themes.json to the archive that ......
Read more >Mixed up Test configuration when using @ResourceArg
The lifecycle manager is working as expected; it appropriately starts/ doesn't start keycloak when configured either way.
Read more >Integration Tests with Keycloak & Testcontainers (& Quarkus)
How to do proper unit and integration testing (and NOT integrated tests ) of your Keycloak based application with the help of Testcontainers ......
Read more >quarkus/KeycloakTestResourceLifecycleManager.java at main
Go to file T · Go to line L · Copy path · Copy permalink.
Read more >Testing Your Application - Quarkus
We also set the java.util.logging.manager system property to make sure ... the resource before Quarkus starts (e.g. configure a KeyCloak instance, add data ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It should be called
KeycloakTestResourceLifecycleManager
btw.I figured out that the current
integration-tests/oidc
runs a test container via maven plugin.I migrated the
QuarkusTestResourceLifecycleManager
to a separatetest-framework
module and enabled the test container to run programmatically rather then a maven plugin.All previous test seems to be working.
Also, I did not change the maven profile configurations so that it wont be a problem during CI pipeline.
To run the test