Massimo Da Ros
Massimo Da Ros

Reputation: 403

is Provider-Driven Contract Testing possible with pact?

Is it possible with pact to let the provider create the definition of the contract and share it with consumers?

Upvotes: 2

Views: 1622

Answers (2)

Matthew Fellows
Matthew Fellows

Reputation: 4065

First of all, no, it's not currently possible to have the provider generate a contract and share it with consumers. We are working on that at Pactflow.

I think it would be useful to know how to manage situations where many consumers define the contract and the only provider has to be compliant with all of them.

  1. In most cases, it's not an issue - consumers generally use your API in very similar ways (especially when retrofitting)
  2. In the consumer-driven sense, it's rare to have multiple consumers driving design of the API at the same time - it's usually just one that's helping create the initial shape
  3. If consumers start having very different (potentially conflicting) needs of a provider, then perhaps there is a genuine case to split the provider into multiple services.
  4. The provider is also free to reject any requests (i.e. contracts with new/different expectations) from consumers.

Upvotes: 1

Artem Ptushkin
Artem Ptushkin

Reputation: 1299

Not yet, take a look at this article.

I'd advise Spring Cloud Contract for the provider driven approach.

Upvotes: 1

Related Questions