-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Providers #39
Comments
No, it's not designed to be used like this. I don't think there is a DELETE for /pact, only /interactions. |
So is there any way to test multiple providers against one instance of pact-mock-service? |
You can run multiple pact mock service instances, specifying different ports for each with the --port option, with each instance representing a different provider. Multiple providers in a single running instance is not supported. |
That's sad to hear. There are two or more possibilities to do so. |
There are, to the best of my knowledge, no plans to do so, as it would involve quite a bit of work, and potentially a modification to the pact file specification, which is shared by many implementations. Out of curiosity, is there a reason you can't just have a separate mock for each required provider? |
If you give the consumer and provider names in the POST /pact call rather than at startup, it will use them to write the pact. Have a look at this code: https://github.com/bethesque/pact-mock_service/blob/master/lib/pact/mock_service/request_handlers/pact_post.rb Actually, I've just come across DELETE /session - this might be what you're after, I'd forgotten about it because I didn't write it. https://github.com/bethesque/pact-mock_service/blob/master/lib/pact/mock_service/request_handlers/session_delete.rb |
@bethesque thanks I was looking for such solution, but I found different one already. :) Anyway It's worth to add /session [DELETE] to github wiki. |
This is how I solved it using one pact-mock-service running on port 1234. after each provider test:
|
Closing as workaround provided, thanks |
The problem is about
/pact
DELETE
. I have few tests within same consumer for multiple providers. When interactions forProvider A
are finished I callDELETE
on/pact
and I would like to go with nextProvider B
. But when I do this I inheritProvider A
interactions in pact file ofProvider B
, so for real they are not deleted.Is there possibility to create pacts for multiple providers within one instance of
pact-mock-service
?The text was updated successfully, but these errors were encountered: