-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ConversionException/NPE in @QuarkusTest and using Pact-JVM Jupiter Provider #9677
Comments
Just fiddled around with that and it seems that the QuarkusTest-Extension tries to clone
Unfortunately it seems that @BeforeEach
void before(PactVerificationContext context) {
context.setTarget(new AmpqTestTarget());
var deepClone = new XStreamDeepClone(getClass().getClassLoader());
var b = deepClone.clone(context); // Exception happens
} |
We can't avoid deep cloning since the arguments need to converted to be loaded by the ThreadContext ClassLoader. |
@geoand can you tell if deep cloning can be avoided once JUnit5 resolves the issue junit-team/junit5#201 ? I see that #9886 has been resolved to fix the Supplier use case in a very specific way; however I can't see pointers to a general solution to solve the problem in this issue for example. |
Yes, if JUnit fixes that issue (we have been monitoring it), then all nastiness of doing the deep cloone should go away |
Is there some update on that issue? I just tested with Quarkus 1.11.1.Final and pact 4.1.15, the issue is the same. |
Have any workarounds been identified for this issue, or is Pact unable to run with Quarkus for now? |
I just faced the same issue here. |
This can interfere with other JUnit exists, such as Pact. Relates to quarkusio#9677
If you run with this PR: #17306 And add the following to application.properties:
Then Pact will work. Ideally this would add these artifact to Quarkus as being parent-first so it would 'just work', however the only place that really makes sense is core, which does not really feel right. @geoand WDYT? |
Sure, it's not ideal to have this configuration in the core module, but we already do it for mockito (which no reasonable person would use outside of a test), so I think it's fine. |
This can interfere with other JUnit exists, such as Pact. Relates to quarkusio#9677
This can interfere with other JUnit exists, such as Pact. Also make Pact parent first. Fixes quarkusio#9677
Did this resolution work for anyone here? I'm still getting the exact same error, and I've updated to the Quarkus version where the PR is baselined.
I've updated my Quarkus Maven Plugin to the same, and I've made the necessary additions to |
@stuartwdouglas used for the fix the old pact artifact ids which were used until Apr, 2020. I was able to make it work by added those to @stuartwdouglas should I do a pull request with those appended to the list or should I replace the old artifact ids? |
Go ahead and add the new coordinates to the list |
Relates to quarkusio#9677 (cherry picked from commit 70902a0)
@skattela I'm extremely grateful to your amazing eye! Looks like my |
I dont think that you need the entries in the |
@skattela I'm missing from your example how to use CDI managed beans from Quarkus in the Pact verification test. In our case, we want to use a service to get the provider into a state, but the injected service is always null. More specifically, in our |
About my previous comment: Here's the first instance creation (which will then be used by Pact) Maybe we can return the @geoand I think this is a question for you EDIT: I opened this as its own issue, see #22611 |
Describe the bug
FollowUp to #8978 @tgippi
After Upgrading to Quarkus 1.5.0.Final Provider-Tests are still not possible, because the QuarkusTestExtension fails to xstream.deepCopy some Test-Context
Expected behavior
Tests should run, like in Quarkus 1.2.x
Actual behavior
To Reproduce
checkout
git@github.com:Sabartius/quarkus-pact-issue.git
run with
mvn -P1.5 clean test
Configuration
Screenshots
Environment (please complete the following information):
uname -a
orver
:java -version
:Java 11
1.5.0-Final
mvnw --version
orgradlew --version
):Maven 3.6.3
Additional context
The text was updated successfully, but these errors were encountered: