-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding @QuarkusTest support for PactVerifyProvider #1506
Comments
I can confirm this issue with a HttpTestTarget on the latest version 4.4.2 The instance of the Provider when it is running through the I assume this issue is on Quarkus side, since it does its compile-time magic in order to startup the app for |
/jira ticket |
👋 Thanks, Jira [PACT-546] ticket created. |
This is a QuarkusTest issue. I took the https://github.com/quarkusio/quarkus-quickstarts/tree/main/amazon-sns-quickstart example and added a similar test as yours above, and I can see the following while running the test with a debugger. In the
with the injected fields null. Then in the test
This is the same for the actual test run with the
Compare this with a normal jUnit 5 Pact test, you see that In the
Then in the test
So it looks like something from the |
Having a very brief look at the QuarkusTest source code, I think what is happening is that QuarkusTest is intercepting all the JUnit 5 method calls and setting up appropriate state. But it won't know about any of the Pact specific method calls, so those are probably running with the original test instance and not the QuarkusTest setup one. |
Any updates on this? I'm facing a similar issue :( Thank you so much in advance! |
@rholshausen, I can confirm your analysis, although the changes being done by the Quarkus framework extend past state to things like CDI bean injection. I think this will be fixed by quarkusio/quarkus#34681. The best Quarkus experience will come from using the Quarkus Pact extensions, and for Quarkus 3+ the extensions are needed. |
Hi,
we are currently evaluating pact and try to setup MessageTestTarget on provider side. We are using Quarkus injection. However pact and Quarkus don´t work together currently in this scenario. When starting the test our code will be injected, but when the @PactVerifyProvider method will be called pact seems to invoke and use a new instance of the test class instead of using the existing one. So all our injections are null.
The test is successful if we remove Quarkus injection.
The text was updated successfully, but these errors were encountered: