What is KTestify?
KTestify is a modular, open-source framework for testing Apache Kafka data pipelines. It gives teams a clean Gherkin DSL to produce messages, consume from output topics, and assert record content, all that without writing a single line of Kafka client code.
Modules
A pure Java library with producer and consumer abstractions, pluggable record matchers (JSON, XML, XPath, Avro), dynamic variable injection, and a HOCON-based configuration system.
A standalone Cucumber adapter with DataTable-driven step definitions for topics, namespaces, schemas, and scripts. Write integration tests in plain English — no Kafka client code required.
Extend your test scenarios with Azure Blob Storage steps. Upload files, validate blob contents, and chain blob checks with Kafka assertions — all from the same feature file.
How it works
Write scenarios in plain English. KTestify handles topic wiring, message production, offset management, and record matching — so your tests stay readable.
Feature: Order stream validation
Background:
Given output topic
| topicName | topicAlias | namespace |
| orders-out | enriched | com.example |
Given assets directory
| path |
| src/test/resources/assets |
Scenario: Enriched order appears on the output topic
When record from file is sent
| topicName | messageFile |
| orders-in | order-123.json |
Then expected record from file
| topicAlias | expectedFile |
| enriched | order-enriched-output.json |
Browse the documentation to get started, or explore the source on GitHub.