Overriding the configuration of a Quarkus app from its test code #41661
Replies: 3 comments 4 replies
-
Thanks for this guide! I have been stuck due to a Quarkus bug #38774 with @TestProfiles and metaspace usage... but I should be able to rewrite the tests using Mockito outlined in this blog to get around it. |
Beta Was this translation helpful? Give feedback.
-
You could consider another approach based on MicroProfile: registering a custom ConfigSource. With a little effort, you can make sure it is reset before each test (using a quarkus before each hook SPI) and you can hide the logic to look up the custom source (needed to override a specific value in a test) behind a static method. It's similar to the Mockito approach, except without Mockito. |
Beta Was this translation helpful? Give feedback.
-
I tried the approach described in section Quarkus Test Profiles, under
But it results in a |
Beta Was this translation helpful? Give feedback.
-
Overriding the configuration of a Quarkus app from its test code
Quarkus: Supersonic Subatomic Java
https://quarkus.io/blog/overriding-configuration-from-test-code/?ref=dailydev
Beta Was this translation helpful? Give feedback.
All reactions