MockProducer
In-memory stand-ins for the Kafka producer and consumer, shipped in kafka-clients for unit tests.
A MockProducer records what was sent and lets a test complete or fail each send. A MockConsumer hands out records the test adds and needs its beginning offsets set before it can poll.