You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2019/01/07 21:41:00 UTC
[jira] [Commented] (KAFKA-6460) Add mocks for state stores used in
Streams unit testing
[ https://issues.apache.org/jira/browse/KAFKA-6460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16736399#comment-16736399 ]
Guozhang Wang commented on KAFKA-6460:
--------------------------------------
It should be part of the public test-utils package, and this ticket also involves 1) adding a {{StoreTestDriver}} which can provide mock {{StoreSupplier}}s and {{StoreBuilder}}s, which can provide different mocks of {{StateStore}}s; 2) and these state stores should be using the {{MockProcessorContext}} existed in the test-utils already, and 3) refactoring the internal unit tests of Streams to leverage on the newly added state store / supplier / record collector and remove any of these vanilla ones (e.g. {{KeyValueStoreTestDriver}}).
[~shung] Are you interested in picking this up?
> Add mocks for state stores used in Streams unit testing
> -------------------------------------------------------
>
> Key: KAFKA-6460
> URL: https://issues.apache.org/jira/browse/KAFKA-6460
> Project: Kafka
> Issue Type: Improvement
> Components: streams, unit tests
> Reporter: Guozhang Wang
> Priority: Major
> Labels: newbie++
>
> 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. This involves implementing the two interfaces {{StoreSupplier}} and {{StoreBuilder}} that can return a object created from, say, EasyMock, and the object can then be set up with the expected calls.
> In addition, we should also add a mock record collector which can be returned from the mock processor context so that with logging enabled store, users can also validate if the changes have been forwarded to the changelog as well.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)