
com.awilton.junit.kafka.samples.SampleEmbeddedTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kafka-unit Show documentation
Show all versions of kafka-unit Show documentation
JUnit utilities for testing kafka clients
The newest version!
package com.awilton.junit.kafka.samples;
import org.junit.Test;
import com.awilton.junit.kafka.embedded.EmbeddedKafka;
public class SampleEmbeddedTest {
private static final EmbeddedKafka kafka = new EmbeddedKafka(5200,5201);
private final String topic = "EmbeddedTopic";
@Test
public void sampleEmbeddedTest() throws Exception {
for (int i=0;i<5;i++) {
Thread.sleep(500);
kafka.getProducer().send(topic, "Embedded:"+i);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy