Package com.avoka.fc.core.stream.test
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>
Provide a Mock Kafka producer.
- Since:
- 22.10.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetKafkaProducer
(Properties properties) return a producer to produce messageget the properties.get the producer.void
setProducer
(org.apache.kafka.clients.producer.Producer<String, String> producer) set the producer for creating different test casesMethods inherited from class com.avoka.fc.core.stream.KafkaStreamProducer
sendToStream, sendToStream
-
Constructor Details
-
MockKafkaStreamProducer
public MockKafkaStreamProducer()
-
-
Method Details
-
getProducer
get the producer.- Returns:
- the producer
-
getKafkaProperties
get the properties. This will be used just in test cases to verify the functionality of Kafka Producer.- Returns:
- the properties.
-
setProducer
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 classKafkaStreamProducer
- Parameters:
properties
- The producer configs- Returns:
- a producer
-