JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
The Pact interface has a method fun mergeInteractions(interactions: List<Interaction>) and a property val interactions: List<Interaction>.
This could be all and well if the RequestResponsePact did not exposes an incompatible property List<RequestResponseInteraction> interactions.
In theory, this should be a compile error, but I guess the Groovy compiler is (once again) too permissive.
The other oddity is that the same class use an unsafe cast in the void mergeInteractions(List<Interaction> interactions) method.
I see two options here: Either the class can manage to work with a list of Interaction instead of RequestResponseInteraction, either the Pact interface has to be generified so that the generic contract is satisfied.
As of now, working in Java, this code does not compile:
The Pact interface has a method
fun mergeInteractions(interactions: List<Interaction>)
and a propertyval interactions: List<Interaction>
. This could be all and well if the RequestResponsePact did not exposes an incompatible propertyList<RequestResponseInteraction> interactions
.In theory, this should be a compile error, but I guess the Groovy compiler is (once again) too permissive. The other oddity is that the same class use an unsafe cast in the
void mergeInteractions(List<Interaction> interactions)
method.I see two options here: Either the class can manage to work with a list of
Interaction
instead ofRequestResponseInteraction
, either the Pact interface has to be generified so that the generic contract is satisfied.As of now, working in Java, this code does not compile: