liveBook · Manning

TestInputTopic

As explained in Kafka for Architects

TestInputTopic is a Kafka Streams testing class that provides serialized records as input to a topology under test.

TestInputTopic feeds serialized records into a Kafka Streams topology under test. Used with TopologyTestDriver, it simulates a Kafka input topic without requiring a running cluster or mock producers and consumers. section 10.3.1

A topology test uses TestInputTopic to:

  • Specify the input topic name together with key and value serializers. section 10.3.1
  • Pipe records through stateless or stateful processing nodes as serialized bytes. section 10.3.1
  • Compare resulting records through TestOutputTopic while optionally simulating time and inspecting intermediate state. section 10.3.1

Topology test boundary

A test creates a TestInputTopic for an input stream, writes serialized events into it, and verifies transformed records on a TestOutputTopic. The topology runs locally, avoiding broker connectivity while exercising serialization and processing behavior. section 10.3.1

How Kafka for Architects covers it

How deep it goes
Defines topic setup, serialization, output verification, time progression, and intermediate-state inspection without detailing implementation code.
Examples
Uses simulated input and output topics to verify transformed records, serialized bytes, time progression, and intermediate state.
What it assumes
Assumes Kafka Streams topologies, topics, serializers, and deserializers; it avoids requiring broker connectivity.
What you can do after
Apply it via TopologyTestDriver to inject records and verify Kafka Streams topology behavior locally.
How it connects
Connects Kafka Streams testing with TopologyTestDriver, TestOutputTopic, serialization, stateful processing, and integration testing.

Also explained in

Compare how 2 books explain TestInputTopic →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka for Architects. The section links point to the parts of the book it draws on.