This sample project demonstrates how we can run contract tests against a service which interacts with a kafka broker.
Here we are using AsyncAPI 3.0.0 specification. For equivalent AsyncAPI 2.6.0 API specification based implementation, please refer to this repository.
This project includes a consumer that listens to messages on receive topic for requests and then upon receiving a message, it processes the same and publishes a reply message to send topic. Thereby it demonstrates the request reply pattern in AsyncAPI 3.0.0 specification also.
- Gradle
- JDK 17+
./gradlew clean test
You will now see a detailed HTML report in build/reports/index.html
with the messages that were sent and received as part of the contract tests.