What is KTestify?
KTestify is a modular, open-source framework for integration-testing Kafka and Kafka Streams data pipelines.
At its core sits a transport-agnostic engine that separates concerns cleanly into three layers: Transport, Orchestration, and Assertion.
A Cucumber/Gherkin adapter (ktestify-cucumber) lets teams write plain-English test scenarios that produce messages, consume from output topics, and assert record content without touching a single line of 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 |
KTestify does not stop at Kafka clients and Gherkin steps. Its modular architecture lets you extend the framework with custom transports and matchers through plugins.
For example, the Azure Blob Storage plugin lets you interact with Azure Blob Storage to check that your Sink or Source Kafka connectors are working as expected. The HTTP plugin lets you test synchronous request and response flows.
How this documentation is organized
The documentation follows four purpose-based sections. Pick the one that matches what you are trying to do, not who you are.
| Section | What it is for | Start here |
|---|---|---|
| Tutorials | Learning-oriented walkthroughs that take you from zero to a running test | Installation |
| How-to Guides | Task recipes for writing steps, using plugins, and extending the framework | Writing tests overview |
| Reference | Lookup tables: every step, config key, matcher, and plugin | Step reference |
| Explanation | Understanding-oriented material on architecture and core concepts | Architecture |
Module overview
| Module | Role |
|---|---|
ktestify-core | Transport-agnostic library, Kafka clients, matchers, config, models |
ktestify-cucumber | Standalone Cucumber/Gherkin application, step definitions, hooks, services |
ktestify-plugin-azureblob | Azure Blob Storage plugin for validating connector output |
ktestify-plugin-http | HTTP request and response transport plugin |
ktestify-plugin-notifications | Suite-level notification plugin for Teams, Slack, and webhooks |
Quick links
- Install and run, Docker image or standalone JAR: Tutorials
- CI environment requirements, a dedicated Kafka stack is mandatory: CI environment
- Full step reference: Step reference
- Architecture deep-dive: Explanation
- CHANGELOG: ktestify-core