20 May 2020 - Setup EmbeddedKafka for Unit Testing Kafka in Java
Unit testing Kafka can be a pain, it seems a lot of overkill to have an entire Kafka cluster ready just for unit testing purposes, luckily, spring-kafka-test helps with this by providing an Embedded Kafka instance you can use to produce or consume messages.
This article contains a short How-To guide on setting up Embedded Kafka to be used for unit testing an application.
TL;DR:- Using embedded kafka is a simple way to run unit tests that don’t have or need a local Kafka instance, such as your CI server