Skip to content

Instantly share code, notes, and snippets.

@kcmvp
kcmvp / KafkaProducerTest.java
Created May 26, 2020 — forked from itzg/KafkaProducerTest.java
Using embedded Kafka in Spring Boot unit test
View KafkaProducerTest.java
import static org.junit.Assert.assertThat;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasKey;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasValue;
import static org.springframework.kafka.test.utils.KafkaTestUtils.getSingleRecord;
import java.util.Map;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.serialization.Deserializer;
You can’t perform that action at this time.