You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ch...@apache.org on 2024/10/24 18:35:14 UTC
(kafka) branch trunk updated: KAFKA-17854 Improve tests for ReadOnlyWindowStoreStub#fetch and #backwardFetch (#17586)
This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new fc4b739578f KAFKA-17854 Improve tests for ReadOnlyWindowStoreStub#fetch and #backwardFetch (#17586)
fc4b739578f is described below
commit fc4b739578f7648e8999978937db420d79988d3b
Author: Yung <yu...@gmail.com>
AuthorDate: Fri Oct 25 02:35:07 2024 +0800
KAFKA-17854 Improve tests for ReadOnlyWindowStoreStub#fetch and #backwardFetch (#17586)
Reviewers: Chia-Ping Tsai <ch...@gmail.com>
---
.../state/internals/CompositeReadOnlyWindowStoreTest.java | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java
index b74afa47eb2..18e775033f0 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java
@@ -362,9 +362,8 @@ public class CompositeReadOnlyWindowStoreTest {
secondUnderlying.put("b", "b", 10L);
secondUnderlying.put("c", "c", 10L);
final List<KeyValue<Windowed<String>, String>> results =
- StreamsTestUtils.toList(windowStore.fetch("a", null, ofEpochMilli(0), ofEpochMilli(10)));
+ StreamsTestUtils.toList(windowStore.fetch("b", null, ofEpochMilli(0), ofEpochMilli(10)));
assertThat(results, equalTo(Arrays.asList(
- KeyValue.pair(new Windowed<>("a", new TimeWindow(0, WINDOW_SIZE)), "a"),
KeyValue.pair(new Windowed<>("b", new TimeWindow(10, 10 + WINDOW_SIZE)), "b"),
KeyValue.pair(new Windowed<>("c", new TimeWindow(10, 10 + WINDOW_SIZE)), "c"))));
}
@@ -377,11 +376,10 @@ public class CompositeReadOnlyWindowStoreTest {
secondUnderlying.put("b", "b", 10L);
secondUnderlying.put("c", "c", 10L);
final List<KeyValue<Windowed<String>, String>> results =
- StreamsTestUtils.toList(windowStore.fetch(null, "c", ofEpochMilli(0), ofEpochMilli(10)));
+ StreamsTestUtils.toList(windowStore.fetch(null, "b", ofEpochMilli(0), ofEpochMilli(10)));
assertThat(results, equalTo(Arrays.asList(
KeyValue.pair(new Windowed<>("a", new TimeWindow(0, WINDOW_SIZE)), "a"),
- KeyValue.pair(new Windowed<>("b", new TimeWindow(10, 10 + WINDOW_SIZE)), "b"),
- KeyValue.pair(new Windowed<>("c", new TimeWindow(10, 10 + WINDOW_SIZE)), "c"))));
+ KeyValue.pair(new Windowed<>("b", new TimeWindow(10, 10 + WINDOW_SIZE)), "b"))));
}
@Test
@@ -407,9 +405,8 @@ public class CompositeReadOnlyWindowStoreTest {
secondUnderlying.put("b", "b", 10L);
secondUnderlying.put("c", "c", 10L);
final List<KeyValue<Windowed<String>, String>> results =
- StreamsTestUtils.toList(windowStore.backwardFetch("a", null, ofEpochMilli(0), ofEpochMilli(10)));
+ StreamsTestUtils.toList(windowStore.backwardFetch("b", null, ofEpochMilli(0), ofEpochMilli(10)));
assertThat(results, equalTo(Arrays.asList(
- KeyValue.pair(new Windowed<>("a", new TimeWindow(0, WINDOW_SIZE)), "a"),
KeyValue.pair(new Windowed<>("c", new TimeWindow(10, 10 + WINDOW_SIZE)), "c"),
KeyValue.pair(new Windowed<>("b", new TimeWindow(10, 10 + WINDOW_SIZE)), "b"))));
}
@@ -422,10 +419,9 @@ public class CompositeReadOnlyWindowStoreTest {
secondUnderlying.put("b", "b", 10L);
secondUnderlying.put("c", "c", 10L);
final List<KeyValue<Windowed<String>, String>> results =
- StreamsTestUtils.toList(windowStore.backwardFetch(null, "c", ofEpochMilli(0), ofEpochMilli(10)));
+ StreamsTestUtils.toList(windowStore.backwardFetch(null, "b", ofEpochMilli(0), ofEpochMilli(10)));
assertThat(results, equalTo(Arrays.asList(
KeyValue.pair(new Windowed<>("a", new TimeWindow(0, WINDOW_SIZE)), "a"),
- KeyValue.pair(new Windowed<>("c", new TimeWindow(10, 10 + WINDOW_SIZE)), "c"),
KeyValue.pair(new Windowed<>("b", new TimeWindow(10, 10 + WINDOW_SIZE)), "b")
)));
}