Getting started
First off, install the DSL package that's right for your language:
- Typescript
- Java
npm install --save-dev @contract-case/contract-case-jest
# You may also need the peer dependencies:
npm install --save-dev jest@^29.4.3
// gradle short
dependencies {
testImplementation 'io.contract-testing.contractcase:contract-case:0.1.0'
}
// Maven
<dependency>
<groupId>io.contract-testing.contractcase</groupId>
<artifactId>contract-case</artifactId>
<version>0.1.0</version>
<scope>test</scope>
</dependency>
Contract testing lifecycle
Here's the lifecycle of a contract test:
- Define a contract
- Define examples
- Run tests to confirm the examples are correct
- Upload contracts to a broker
- Verify the contract
- Download contract from the broker
- Verify the contract
- Publish verification result to the broker
Next steps
If you just want to jump in to some examples, you can have a read of:
- Typescript client-driven contract definition
- Typescript client-driven contract verification
- Typescript server-driven contract definition
- Typescript server-driven contract verification
If you're new to contract testing, have a read of what is contract testing.
If you're defining a contract, start here. If you're verifying an existing contract, start here.