Dynamic environment variables with @QuarkusIntegrationTest #43317
Unanswered
erke-soptim
asked this question in
Q&A
Replies: 3 comments 5 replies
-
/cc @geoand (testing) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm actually surprised about the different behavior in native vs JVM test. Is there any chance you can attach a simplified sample application that exhibits the problematic behavior in action? Thanks |
Beta Was this translation helpful? Give feedback.
1 reply
-
@soptim-erke Just for clarification: are you trying to modify an application bean within a |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there 👋
I am currently stuck trying to introduce
@QuarkusIntegrationTest
to an existing codebase. My test setup requires starting a LocalStack container exposing an api that I want to talk to in a test. This is done in a customQuarkusTestResourceLifecycleManager
. To allow my code to talk to the "real" api in production and the local api when testing, the corresponding service class has a static client field that gets overriden in the lifecycle manager.Service.java
MyLifecycleManager.java
This works well when running non-native tests, but fails for native tests, because the Service is already compiled and cannot be modified by MyLifecycleManager. I tried passing
container.getURL()
andcontainer.getSecret()
via environment variables, but that does not seem to work, because I have no control over the process running the build artifact. I did find 33806, but that only seems to talk about static environment variables. I specifically need to inject environment variables that are only known at runtime.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions