frankvicky commented on code in PR #21580:
URL: https://github.com/apache/kafka/pull/21580#discussion_r2873702738
##########
streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableSourceTest.java:
##########
@@ -217,38 +292,71 @@ public void testValueGetter() {
final KTableValueGetter<String, String> getter1 =
getterSupplier1.get();
getter1.init(driver.setCurrentNodeForProcessorContext(table1.name));
- inputTopic1.pipeInput("A", "01", 10L);
- inputTopic1.pipeInput("B", "01", 20L);
- inputTopic1.pipeInput("C", "01", 15L);
-
- assertEquals(ValueAndTimestamp.make("01", 10L), getter1.get("A"));
- assertEquals(ValueAndTimestamp.make("01", 20L), getter1.get("B"));
- assertEquals(ValueAndTimestamp.make("01", 15L), getter1.get("C"));
-
- inputTopic1.pipeInput("A", "02", 30L);
- inputTopic1.pipeInput("B", "02", 5L);
-
- assertEquals(ValueAndTimestamp.make("02", 30L), getter1.get("A"));
- assertEquals(ValueAndTimestamp.make("02", 5L), getter1.get("B"));
- assertEquals(ValueAndTimestamp.make("01", 15L), getter1.get("C"));
-
- inputTopic1.pipeInput("A", "03", 29L);
-
- assertEquals(ValueAndTimestamp.make("03", 29L), getter1.get("A"));
- assertEquals(ValueAndTimestamp.make("02", 5L), getter1.get("B"));
- assertEquals(ValueAndTimestamp.make("01", 15L), getter1.get("C"));
-
- inputTopic1.pipeInput("A", null, 50L);
- inputTopic1.pipeInput("B", null, 3L);
-
- assertNull(getter1.get("A"));
- assertNull(getter1.get("B"));
- assertEquals(ValueAndTimestamp.make("01", 15L), getter1.get("C"));
+ // Send records with unique headers for each key
+ final Headers headersA = makeHeaders("key", "A");
+ final Headers headersB = makeHeaders("key", "B");
+ final Headers headersC = makeHeaders("key", "C");
+
+ inputTopic1.pipeInput(new TestRecord<>("A", "01", headersA, 10L));
+ inputTopic1.pipeInput(new TestRecord<>("B", "01", headersB, 20L));
+ inputTopic1.pipeInput(new TestRecord<>("C", "01", headersC, 15L));
+
+ if (storeFormat.equals("defaults")) {
Review Comment:
We should introduce a const for `defaults` and `headers` since these two
value are using everywhere.
--
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]