com.awilton.junit.kafka.samples.SampleRunnerTest 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 org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.awilton.junit.kafka.annotations.UseKafka;
import com.awilton.junit.kafka.embedded.EmbeddedProducer;
import com.awilton.junit.kafka.runners.KafkaRunner;
@UseKafka(zkPort=5100, kafkaPort=5101)
@RunWith(KafkaRunner.class)
public class SampleRunnerTest
{
private static Logger log = LoggerFactory.getLogger("foo");
@Test
public void TestZK() throws Exception {
log.info("Testing");
EmbeddedProducer producer = new EmbeddedProducer(5101);
for (int i=0;i<100; i++) {
producer.send("fooTest", "TestLoop:"+i);
Thread.sleep(50);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy