-
Notifications
You must be signed in to change notification settings - Fork 217
Why Pact may not be the best tool for testing pass through APIs
During pact verification, Pact does not test the side effects of a request being executed on a provider, it just checks that the response body matches the expected response body. If your API is merely passing on a message to a downstream system (eg. a queue) and does not validate the contents of the body before doing so, you could send anything you like in the request body, and the provider would respond the same way. The "contract" that you really want is between the consumer and the downstream system. Checking that the provider responded with a 200 OK does not give you any confidence that your consumer and the downstream system will work correctly in real life.
What you really need is a "non-HTTP" pact between your consumer and the downstream system. This is something we have been thinking about, but have not yet started any development. We would like to have a few different use cases to drive this functionality. If this interests you, please have a chat to us on the pact-dev Google group.