vpapavas commented on a change in pull request #11541: URL: https://github.com/apache/kafka/pull/11541#discussion_r760015271
########## File path: streams/src/test/java/org/apache/kafka/streams/state/internals/InMemorySessionStoreTest.java ########## @@ -83,4 +88,31 @@ public void shouldNotExpireFromOpenIterator() { assertFalse(sessionStore.findSessions("a", "b", 0L, 20L).hasNext()); } + @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.update("input", 0, offset); + offset++; + } + + final MeteredSessionStore<String, Long> meteredSessionStore = (MeteredSessionStore<String, Long>) sessionStore; Review comment: I agree, I don't think it is bad in the context of a unit test -- 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