How to use Testcontainers and Dependencie Injection ? #28154
-
I try to migrate my Integration Test Class to use @testcontainers. Original Test Class was like
After rewrite it looks like this
So after removing the @QuarkusTest annoation, dependency injection of my service not work anymore. How to use Testcontainers and Dependency Injection here? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
Also, I don't see any tests in Quarkus that would use |
Beta Was this translation helpful? Give feedback.
@QuarkusTest
is a Quarkus JUnit extension which takes care of Quarkus startup and provides the test instance which is injected into.If you remove this extension and replace it with
@Testcontainers
(which is provided by JUnit and not related to Quarkus in any way), then Quarkus functionality will disappear.Also, I don't see any tests in Quarkus that would use
@Testcontainers
ATM so I'd say this isn't supported.Am I right @geoand?