Quarkus now supports test profiles #27696
Replies: 2 comments 3 replies
-
Test profile should always have class and constructor level public visibility, as for 2.7.5, for Quarkus to find the constructor. It can be empty. |
Beta Was this translation helpful? Give feedback.
-
Hi, I do have a question to TestProfiles and overriding config, because I do not quite get it to work, at least not in an elegant way. I have a common TestProfile which produces several beans used during the tests like:
Now, for one test I want one bean to be replaced with a different implementation. Therefore, I added a profile for that special test like this:
If I run this, I get ambiguous bean exception. I was able to fix this by setting the profile name explicitely in SpecialTestProfile like this:
Afterward I added @IfBuildProfile annotation to SpecialTestProfile and @UnlessBuildProfile annotation to TestConfig. Both annotations were needed to avoid ambiguous bean exception. This solution is not very nice and the certainly is a cleaner way to do this. I also tried @Alternative annotation on SpecialTestProfile but it did not work. Any insights on this would be welcome. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Quarkus now supports test profiles
Quarkus: Supersonic Subatomic Java
https://quarkus.io/blog/quarkus-test-profiles/
Beta Was this translation helpful? Give feedback.
All reactions