intermediate~1h
Testing the Consumer with Embedded Kafka
The producer's Embedded Kafka test (Module 07) proved a record lands in Kafka. This module proves the consumer turns that record into correct database state — the assertion that actually matters end to end.
Learning objectives
- Beginner: Explain what an Embedded Kafka consumer test proves that a producer-side test alone doesn't.
- Intermediate: Set up an Embedded Kafka test that asserts the consumer correctly persists a consumed record to the database.
- Advanced: Diagnose a flaky consumer test caused by asserting before the consumer's poll loop has actually processed the message.
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.
Testing the Consumer with Embedded Kafka