EmbeddedKafkaBroker is a Spring-Kafka test component that starts an in-memory Kafka broker for integration tests. It behaves like a broker without requiring a shared Kafka cluster or external infrastructure. section 10.3.2
EmbeddedKafkaBroker supports a focused integration-testing workflow:
- Start the broker with the test and shut it down when the test completes. section 10.3.2
- Keep application logic unchanged because broker substitution is handled through test configuration. section 10.3.2
ProfileService producer test
A test invokes ProfileService, which publishes a Kafka message to the in-memory broker. A test consumer reads the message and evaluates its content and metadata.
