Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.23 KB

File metadata and controls

26 lines (17 loc) · 1.23 KB

Specmatic Kafka Sample

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.

Background

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.

Specmatic Kafka Sample Architecture

Pre-requisites

  • Gradle
  • JDK 17+

Run the tests

./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.