vvcephei commented on a change in pull request #11513:
URL: https://github.com/apache/kafka/pull/11513#discussion_r765093493



##########
File path: 
streams/src/test/java/org/apache/kafka/streams/state/internals/InMemorySessionStoreTest.java
##########
@@ -91,29 +90,20 @@ public void shouldNotExpireFromOpenIterator() {
 
     @Test
     public void shouldMatchPositionAfterPut() {
-
-        final List<KeyValue<Windowed<String>, Long>> entries = new 
ArrayList<>();
-        entries.add(new KeyValue<>(new Windowed<String>("a", new 
SessionWindow(0, 0)), 1L));
-        entries.add(new KeyValue<>(new Windowed<String>("aa", new 
SessionWindow(0, 10)), 2L));
-        entries.add(new KeyValue<>(new Windowed<String>("a", new 
SessionWindow(10, 20)), 3L));
-
-        final MonotonicProcessorRecordContext recordContext = new 
MonotonicProcessorRecordContext("input", 0);
-        context.setRecordContext(recordContext);
-
-        final Position expected = Position.emptyPosition();
-        long offset = 0;
-        for (final KeyValue<Windowed<String>, Long> k : entries) {
-            sessionStore.put(k.key, k.value);
-            expected.withComponent("input", 0, offset);
-            offset++;
-        }
-
         final MeteredSessionStore<String, Long> meteredSessionStore = 
(MeteredSessionStore<String, Long>) sessionStore;
         final ChangeLoggingSessionBytesStore changeLoggingSessionBytesStore = 
(ChangeLoggingSessionBytesStore) meteredSessionStore.wrapped();
         final InMemorySessionStore inMemorySessionStore = 
(InMemorySessionStore) changeLoggingSessionBytesStore.wrapped();
 
+        context.setRecordContext(new ProcessorRecordContext(0, 1, 0, "", new 
RecordHeaders()));
+        sessionStore.put(new Windowed<String>("a", new SessionWindow(0, 0)), 
1L);
+        context.setRecordContext(new ProcessorRecordContext(0, 2, 0, "", new 
RecordHeaders()));
+        sessionStore.put(new Windowed<String>("aa", new SessionWindow(0, 10)), 
2L);
+        context.setRecordContext(new ProcessorRecordContext(0, 3, 0, "", new 
RecordHeaders()));
+        sessionStore.put(new Windowed<String>("a", new SessionWindow(10, 20)), 
3L);
+
+        final Position expected = Position.fromMap(mkMap(mkEntry("", 
mkMap(mkEntry(0, 3L)))));
         final Position actual = inMemorySessionStore.getPosition();
-        assertThat(expected, is(actual));
+        assertEquals(expected, actual);

Review comment:
       Not a huge deal, but we tend to prefer `assertThat` to `assertEqual`.




-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to