ableegoldman commented on a change in pull request #8669: URL: https://github.com/apache/kafka/pull/8669#discussion_r425959812
########## File path: streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingWindowBytesStoreTest.java ########## @@ -113,24 +114,26 @@ public void shouldDelegateToUnderlyingStoreWhenFetchingRange() { @SuppressWarnings("deprecation") public void shouldRetainDuplicatesWhenSet() { store = new ChangeLoggingWindowBytesStore(inner, true); + inner.put(bytesKey, value, 0); EasyMock.expectLastCall().times(2); init(); - store.put(bytesKey, value); - store.put(bytesKey, value); final Bytes key1 = WindowKeySchema.toStoreKeyBinary(bytesKey, 0, 1); final Bytes key2 = WindowKeySchema.toStoreKeyBinary(bytesKey, 0, 2); - assertThat(collector.collected().size(), equalTo(2)); - assertThat(collector.collected().get(0).key(), equalTo(key1)); - assertThat(collector.collected().get(0).value(), equalTo(value)); - assertThat(collector.collected().get(0).timestamp(), equalTo(0L)); - assertThat(collector.collected().get(1).key(), equalTo(key2)); - assertThat(collector.collected().get(1).value(), equalTo(value)); - assertThat(collector.collected().get(1).timestamp(), equalTo(0L)); - EasyMock.verify(inner); + EasyMock.reset(context); + EasyMock.expect(context.timestamp()).andStubReturn(0L); + context.logChange(store.name(), key1, value, 0L); + context.logChange(store.name(), key2, value, 0L); Review comment: The `expectLastCall` is redundant if you're not chaining it with something else (like `expectLastCall().times(2)`) I verified this just to be sure by removing the invocation of `context.logChange` in this class and it did indeed fail ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org