DSL (these are the packages you want to install):
Node:
Java:
Read the documentation here. Documentation is currently in-progress. Feedback welcome!
ContractCase is a next-generation consumer-driven contract testing framework, building on many of the lessons from maintaining the excellent Pact contract testing framework. It is our belief that contract testing is the best way to get deployment confidence for your applications and services.
ContractCase releases follow semantic versioning, with two additional restrictions:
- Before 1.0.0, ContractContractCase is in Beta, and the API is considered unstable. Breaking changes will be indicated in minor version bumps- that is, 0.2.0 and 0.3.0 are not entirely compatible.
- Before 1.0.0, patch versions will always be backwards compatible.
Breaking changes will always be detailed in the changelog.
Incomplete documentation is here. By way of apology for the unstable API, at least one new page of documentation will be added every time a breaking change is released during the beta period.
WARNING: THE API IS UNSTABLE AND MAY CHANGE BETWEEN MINOR VERSIONS
ContractCase is now available and should work for both client and server driven http/https contracts. Feedback on the ContractCase API / DSL and (especially) naming conventions very welcome. However, the following caveats should be kept in mind:
- ContractCase is currently only available in Javascript / Typescript and Java. At a later date, support for Python, C# and Go will be added. There are no plans to add other languages at this time.
- ContractCase doesn't yet support merging of contracts. This means that your whole contract must be defined in one test file.
- ContractCase currently is only compatible with Jest (js/ts) and JUnit (java).
- ContractCase currently only has minimal broker support. It supports the Pact broker, although the Pact broker isn't able to render ContractCase contracts yet.
Although the test coverage is high, and great care has been taken to ensure that the results are correct, there may still be bugs. Please open an issue if you experience any problems.
If you want to get started immediately, we recommend starting with either the client-driven end-to-end test, or the server-driven end-to-end test. Make sure you remove printResults: false
.
You can follow the detailed progress by reading the maintainer todo list. These caveats will be updated as progress is made.
ContractCase has a very similar philosophy to Pact, and to maximise Pact compatibility, ContractCase works with the Pact broker. We recommend either:
ContractCase is easier to extend, can express more complex contracts, doesn't restrict where you can use matchers when defining request / response pairs, and can define contracts at either the server side or the client side (although it is always consumer driven - your consumer just might be consuming requests). See for Pact users for more discussion.
- The Pact Broker for users wanting to host their own broke
- The excellent Pactflow Broker for those needing SaaS and enterprise features
Command line interface::
Definition DSL packages:
Connector Packages:
Core Package:
- Pact Parity (complete)
- Server driven contracts (complete)
- Plugins and arbitrary extensions (complete)
- Documentation (in progress)
- gRPC matchers
- Support Python, C# and Go
- Arbitrary combinations of request/response pairs, incidentally including native SQS support
- Pass-through APIs
For the gory details, you can see the implementation notebook / todo list here