...
This is for adding mocks for state stores used in Streams unit testing. We'd like to use mocks for different types of state stores: KV, window, session - that can be used to record the number of expected put / get calls used in the DSL operator unit testing. These will provide conveniency for developers when they are writing unit test for kafka stream and other related modules.
Public Interfaces
These will be internal classes, so not a public API/interfaces.
Proposed Changes
Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.
We will provide a MockStoreFactory to generate Mock store builders:
...
Code Block |
---|
package org.apache.kafka.streams.internals; public class MockKeyValueStoreBuilder<K, V> extends AbstractStoreBuilder<K, V, StateStore> { public MockKeyValueStoreBuilder(final String storeName, final Serde<K> keySerde, final Serde<V> valueSerde, final Time time) { super(storeName, keySerde, valueSerde, time); } @Override public KeyValueStore build() { return new MockKeyValueStore(name, false); } } |
Proposed Changes
...
Compatibility, Deprecation, and Migration Plan
...