Application Testing – CCDAK Study Guide
This domain accounts for 15% of the exam and covers how to test Kafka producer, consumer, and Streams code — the utilities and practices that let you verify behavior without (and with) a real cluster. The exam expects you to know which testing tool fits which component and when a unit test suffices versus needing an integration test.
The Testing Toolkit
| Tool | Tests | How |
|---|---|---|
| TopologyTestDriver | Kafka Streams topologies | In-memory: pipe input records, read outputs, inspect state stores — no cluster |
| MockProducer | Producer logic | In-memory Producer that records sent records |
| MockConsumer | Consumer logic | In-memory Consumer seeded with records/partitions |
| Embedded / test Kafka cluster | End-to-end integration | Real produce/consume, serialization, config |
The key mapping to memorize: Streams topology → TopologyTestDriver; producer → MockProducer; consumer → MockConsumer; end-to-end → embedded cluster.
Unit Testing
- Isolate the logic. Separate message-processing logic from the Kafka client (via dependency injection or mocks) so business logic is unit-testable and decoupled from infrastructure.
- TopologyTestDriver gives deterministic, fast, in-memory verification of stream-processing logic, joins, windows, and state store contents — pipe inputs, assert outputs and state.
- MockProducer/MockConsumer verify producer/consumer behavior without a broker.
- Test error-handling paths (deserialization failures, retries), not just the happy path.
Unlock with a paid plan
5 more sections (about 269 words) continue below. Every paid plan unlocks all CCDAK study guides, the full question bank and mock exams, from $4.97/month.