Class MockKafkaStreamProducer

java.lang.Object
com.avoka.fc.core.stream.KafkaStreamProducer
com.avoka.fc.core.stream.test.MockKafkaStreamProducer
All Implemented Interfaces:
IStreamProducer<org.apache.kafka.clients.producer.RecordMetadata>

public class MockKafkaStreamProducer extends KafkaStreamProducer
Provide a Mock Kafka producer.
Since:
22.10.0
  • Constructor Details

    • MockKafkaStreamProducer

      public MockKafkaStreamProducer()
  • Method Details

    • getProducer

      public org.apache.kafka.clients.producer.Producer<String,String> getProducer()
      get the producer.
      Returns:
      the producer
    • getKafkaProperties

      public Properties getKafkaProperties()
      get the properties. This will be used just in test cases to verify the functionality of Kafka Producer.
      Returns:
      the properties.
    • setProducer

      public void setProducer(org.apache.kafka.clients.producer.Producer<String,String> producer)
      set the producer for creating different test cases
      Parameters:
      producer - the producer
    • getKafkaProducer

      protected org.apache.kafka.clients.producer.Producer<String,String> getKafkaProducer(Properties properties)
      return a producer to produce message
      Overrides:
      getKafkaProducer in class KafkaStreamProducer
      Parameters:
      properties - The producer configs
      Returns:
      a producer