eduwercamacaro commented on code in PR #20403:
URL: https://github.com/apache/kafka/pull/20403#discussion_r2406614927


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/ProcessorTopologyTest.java:
##########
@@ -867,6 +867,27 @@ public void 
testDrivingInternalRepartitioningForwardingTimestampTopology() {
                 equalTo(new TestRecord<>("key3", "value3", null, 3000L)));
     }
 
+
+    @Test
+    public void testTopologyInitializationWithInitialKeyAndValue() {
+        final String initialKey = "key1";
+        final String initialValue = "value1";
+        final StoreBuilder<KeyValueStore<String, String>> storeBuilder =
+                
Stores.keyValueStoreBuilder(Stores.inMemoryKeyValueStore(DEFAULT_STORE_NAME), 
Serdes.String(), Serdes.String()).withLoggingEnabled(Collections.emptyMap());
+        topology.addSource("source1", STRING_DESERIALIZER, 
STRING_DESERIALIZER, INPUT_TOPIC_1);
+        topology.addProcessor("processor1", defineWithStores(() -> new 
StatefulProcessorWithInitialization(DEFAULT_STORE_NAME, initialKey, 
initialValue), Collections.singleton(storeBuilder)), "source1");
+        driver = new TopologyTestDriver(topology, props);
+        final TestInputTopic<String, String> inputTopic = 
driver.createInputTopic(INPUT_TOPIC_1, STRING_SERIALIZER, STRING_SERIALIZER);
+        inputTopic.pipeInput("key2", "value2");

Review Comment:
   Yes, we don't really need it. 
   I just removed it. 
   I was trying to make a distinction between the `process` and `init` methods, 
but that's already covered in the other test cases. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to