import org.apache.kafka.clients.consumer._
val consumer = new MockConsumer[String, String](OffsetResetStrategy.EARLIEST)
MockConsumer
MockConsumer
is a concrete Consumer to be used for unit testing.
Note
|
MockConsumer is used in Kafka Streams' TopologyTestDriver to write tests to verify the behavior of topologies.
|
MockConsumer
takes a single OffsetResetStrategy
to be created.
While being created, MockConsumer
initializes the internal registries and counters.
Beside Consumer API, MockConsumer
defines its own testing-specific API.
Method | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Name | Description |
---|---|
|
Used when…FIXME |
|
Used when…FIXME |
|
Used when…FIXME |
|
|
|
|
|
Used when…FIXME |
|
Used when…FIXME |
|
Used when…FIXME |
|
|
|
Flag that says whether…FIXME (a Java AtomicBoolean) Used when…FIXME |
|
Used when…FIXME |