quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

quarkus.keycloak.devservices.realm-path option is ignored if used in test/resources/application.properties #27202

Closed Ultranium closed 2 years ago

Ultranium commented 2 years ago

Describe the bug

If I set the quarkus.keycloak.devservices.realm-path option in the test/resources/application.properties file, it is ignored by Quarkus. If set in the main/resources/application.properties, then everything works as expected.

Expected behavior

Deploying a Keycloak container initialized with specified realm file.

Actual behavior

Keycloak gets initialized with the default Quarkus realm.

How to Reproduce?

No response

Output of uname -a or ver

Microsoft Windows [Version 10.0.19042.867]

Output of java -version

openjdk version "18.0.2" 2022-07-19

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.11.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.5.1

Additional information

No response

quarkus-bot[bot] commented 2 years ago

/cc @geoand, @pedroigor, @sberyozkin, @stuartwdouglas

Ultranium commented 2 years ago

OK, now I see what's happening.

There are two Keycloak containers created - one for Quarkus Dev Services, and the second one for running tests (is it the expected behavior though?). So, if the quarkus.keycloak.devservices.realm-path option specified in the test/resources/application.properties file, it only applied to the tests Keycloak container, if specified in the main/resources/application.properties, then both Dev Services and tests Keycloak containers are initialized with the specified realm config.