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

@State methods do not not have access to the CDI context #2

Open holly-cummins opened 1 year ago

holly-cummins commented 1 year ago

This was discovered by @edeandrea.

This may need a Quarkus change - or be impossible to fix - but this issue can track the investigation. I assume this is a classloader issue, because in https://github.com/beforeeach methods we have access to the CDI context, but in https://github.com/State methods, we don't - even though it would be very useful in those methods.

https://github.com/pact-foundation/pact-jvm/issues/1604#issuecomment-1252341344 has sample code showing the issue.

holly-cummins commented 1 year ago

See also https://github.com/quarkusio/quarkus/issues/22611, which is a Quarkus work item for the same problem.