snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

@ConfigProperties does not work in @QuarkusTest environment #136

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 4 years ago

I have a class that uses @ConfigProperties as shown below:

@ConfigProperties(prefix = "oidc")
public class OIDCProperties {

    String serverUrl;
    String applicationRealm;
    String adminRealm;
    .......
}

I also tried with @Inject @ConfigProperty, as it is related to this issue: #2061

@Inject
@ConfigProperty(name = "server-url")
String serverUrl;

I have injected it following way to use those configs:

@Inject
OIDCProperties oidcProperties;

It works as it should in the normal run, but in the test environment, I'm getting the injected oidcProperties as null.

In my application.properties, I have:

oidc.server-url=%{oidc_server_url:http://localhost:8180/auth}

Environment:


https://github.com/quarkusio/quarkus/issues/10735


$upstream:10735$