All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.awilton.junit.kafka.annotations.UseKafka Maven / Gradle / Ivy

The newest version!
package com.awilton.junit.kafka.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * When used in conjunction with KafkaRunner
 * the UseKafka annotation instructs JUnit that the 
 * test class requires an embedded Kafka instance.
 * 
 * The UseKafka annotation requires two parameters.
 * The first, zkPort, declares the network port that the embedded
 * Zookeeper service will bind to and listen on.
 * If not specified Zookeeper will attempt to listen 
 * 
 * The second optional parameter, kafkaPort declares the network 
 * port that the embedded Kafka Server will bind to and listen on
 * 
 * 
 * 
 * {@literal @}UseKafka(zkPort=5100, kafkaPort=5101)
 * {@literal @}RunWith(KafkaRunner.class)
 * public class MyTestClass {
 *  // test methods
 * } 
 * 
 * 
 * 
 * @author awilton
 *
 */
@Retention(value = RetentionPolicy.RUNTIME)
public @interface UseKafka {
  int zkPort()  default 2181;
  int kafkaPort() default 9092;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy