Overview of KTestify for Kafka integration testing
KTestify is a modular, open-source framework designed for integration-testing Kafka and Kafka Streams data pipelines. It uses a transport-agnostic engine divided into three layers: Transport, Orchestration, and Assertion. The framework allows developers to write tests using plain-English Gherkin scenarios via the
ktestify-cucumber adapter, enabling the production of messages, consumption from output topics, and record assertions without writing Kafka client code.Feature: Order stream validation
Background:
Given input topic
| topicName | topicAlias |
| orders-in | raw |
Given output topic
| topicName | topicAlias |
| orders-out | enriched |
Given assets directory
| absolutePath |
| src/test/resources/assets |
Scenario: Raw order should be enriched with status
When record from file is sent
| topicName | file | recordKey |
| orders-in | order-123.json | order-123 |
Then expected record from file
| topicAlias | file |
| enriched | order-enriched-output.json |