tl dr Is there a way to merge pact verification re...
# pact-jvm
j
tl dr Is there a way to merge pact verification results before sending it to the pact broker? Hi all, I have a provider multi-modules maven project where I expect some modules to execute parts of the pact verification. The sum of all the module verification would cover all the pacts. I am planning use filters , to decide what states a module should be testing. My understanding is that the results are accumulated in memory, and not shared across junit/test jvms. Which means I am not sure how to assemble those results before sending it to the broker. I want each module to verify some pacts since the business logic is replicated across them. This service is an integration service, so for each external system we support we have a dedicated module for this that implements our service api.
m
hmm I don’t think so, at least a search of the docs suggests it’s not readily available
Could you instead, treat A, B and C as separate providers?
j
Well it would still boil down to the same problem, I would have more than one module implementing A endpoints
t
I would have more than one module implementing A endpoints
This is certainly unusual - although it is a leaky part of pact’s abstraction that the consumer needs to know which services it has that are different
I’ve thought for a long time it would be useful to have a tool that can chop and change Pact files - if we had such a tool, things like this could be built easily
m
I would have more than one module implementing A endpoints
OK I see the problem now. The “uses {B, C}” was confusing to me. It sounds like “implements part of {B, C}” is actually what it does.
t
If I had this situation, I would probably just do contracts between Consumer -> X, Consumer -> Y and Consumer -> Z.
(and then have the Provider verify them all)
Do you need the actual modules to be doing the verification? Why not just spin up the box you’ve marked as Provider, instead?
🤔 1
(as surely that includes the modules)
j
Yes I can test this by spinning up the full provider, but then I would have to control which module receives which request using states. Which means I would be pushing this “implementation detail” to the consumer, and will have to replicate the tests for each Systems. This is something I was trying to avoid, but I guess that will be the way to go.