Simple embedded Kafka test example with spring boot
Embedded Kafka tests work for me with below configs, Annotation on test class @EnableKafka @SpringBootTest(classes = {KafkaController.class}) // Specify @KafkaListener class if its not the same class, or not loaded with test config @EmbeddedKafka( partitions = 1, controlledShutdown = false, brokerProperties = { “listeners=PLAINTEXT://localhost:3333”, “port=3333” }) public class KafkaConsumerTest { @Autowired KafkaEmbedded kafkaEmbeded; @Autowired KafkaListenerEndpointRegistry … Read more