quarkiverse / quarkus-pact

Pact is a widely-recommended framework for consumer-driven contract testing. This Quarkus extension gives the best Pact integration with Quarkus.
https://pact.io/
Apache License 2.0
12 stars 6 forks source link

Upgrade to Quarkus 3.3.0 breaks provider verification tests #148

Closed edeandrea closed 1 year ago

edeandrea commented 1 year ago

I upgraded https://github.com/edeandrea/pact-quarkus-wookie-carpet-demo/tree/wookie/wookie-tamer to Quarkus 3.3.2 and when introducing the contract verification tests that pull from the pact broker I am seeing this stack trace in the console:

2023-09-12 15:44:53,541 ERROR [io.qua.test] (Test runner thread) Test FurResourceContractVerificationTests#Pact between weaver (1.0) and wookie-tamer - A request for wookie fur failed 
: java.lang.NoClassDefFoundError: groovy/lang/Closure
        at au.com.dius.pact.provider.ProviderClient$Companion.invokeIfClosure(ProviderClient.kt:261)
        at au.com.dius.pact.provider.ProviderClient$Companion.access$invokeIfClosure(ProviderClient.kt:252)
        at au.com.dius.pact.provider.ProviderClient.newRequest(ProviderClient.kt:478)
        at au.com.dius.pact.provider.ProviderClient.prepareRequest(ProviderClient.kt:304)
        at au.com.dius.pact.provider.junit5.HttpTestTarget.prepareRequest(TestTarget.kt:96)
        at au.com.dius.pact.provider.junit5.PactVerificationExtension.beforeTestExecution(PactVerificationExtension.kt:136)

I tried backing down to Quarkus 3.3.1 and 3.3.0 but see the same error. When I go to 3.2.5.Final everything works fine.

The test class is https://github.com/edeandrea/pact-quarkus-wookie-carpet-demo/blob/wookie/wookie-tamer/src/test/java/org/wookie/tamer/FurResourceContractVerificationTests.java but removing the @PactFolder("pacts") annotation & uncommenting the other 2 annotations on the class.

Interestingly, running the verification tests when using a local folder containing the pacts seems to be fine.

holly-cummins commented 1 year ago

This is a duplicate of https://github.com/quarkiverse/quarkus-pact/pull/137. See also discussion in https://github.com/quarkiverse/quarkiverse/issues/94#issuecomment-1628807519. I was waiting to do a release of the new code until 3.3.0 was released, but then when it was released I didn't actually do the quarkus-pact release. I'll do that now.

holly-cummins commented 1 year ago

(This should be fully resolved by #149, which does the release.)