I'm using the Pact Go implementation to try out contract testing. I've made a provider test that isn't working because I need to mock out my service's request to Twilio.
I've made one Pact object for the contract between my consumer and this provider, and then another one called twilioPact for the contract between my provider and Twilio. I've added an interaction for the POST to the Twilio endpoint, but in the pact.log I'm not seeing it get registered. My test is making the request correctly, but there's no interaction registered for it so I get the 500 error from the mock server.
Does anyone have any experience using Pact with a 'provider' that is also a 'consumer'?
EDIT: After talking with Matt Fellows I was informed that I was using Pact incorrectly, and shouldn't be trying to run a mock service while running a provider verification. I had suspected as much, but none of the examples I had seen were for a provider that had a dependency. I was able to get my provider verification to work by writing a consumer test and passing the generated pact file to the pact-stub-service to act as the mock to Twilio.
Here's a few things to consider:
client
<->Twilio Adapter
, andTwilio Adapter <-> Twilio
. It's possible to do what you're doing, but it will make the tests more complicated and probably harder to read/comprehend. Testing them in isolation gives you much more control.[1] Here is are the list of binaries etc. that are shipped with pact-go: