Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Unit Testing

Embedded Kafka Cluster


• Start an embedded Kafka Cluster.
• Create the desired topics.
• Send some data to the topic.
• Start your streams application.
• Read the outcome from the Kafka topic.
• Assert the outcome.
Unit Testing

TopologyTestDriver
• Pipe input data to topology
• Run the topology flow
• Read final output of topology
• Assert the outcome.
Advert CTR
State Store Name – cp-store
Campaign Performance
Campaigner
Campaigner |Impressions| Clicks
Ad-Impressions
XYZ Ltd XYZ Ltd 2 1

Source groupBy() leftJoin()


count() Ad Impressions (left)
to()
Processor Campaigner Ad Impressions with Ad Clicks (Right) Sink Processor

Source groupBy() count()


Processor Campaigner Ad Clicks
Campaign-Performance

Ad-Clicks
Advert CTR – Test Cases
Advert CTR – Test Cases
Advert CTR – Test Cases
Advert CTR – Test Cases

You might also like