mjsax commented on code in PR #18816:
URL: https://github.com/apache/kafka/pull/18816#discussion_r2040344194


##########
streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueBytesStoreTest.java:
##########
@@ -89,8 +95,81 @@ public class ChangeLoggingKeyValueBytesStoreTest {
     public void before() {
         context = mockContext();
         context.setTime(0);
+        store = new ChangeLoggingKeyValueBytesStore(innerMock);
         store.init(context, store);
     }
+    private void mockPosition() {
+        when(innerMock.getPosition()).thenReturn(Position.emptyPosition());
+    }
+    private void mockGet(final Map<Bytes, byte[]> mockMap) {
+        when(innerMock.get(any(Bytes.class))).thenAnswer(invocation -> 
mockMap.get(invocation.getArgument(0)));
+    }
+    private void mockPut(final Map<Bytes, byte[]> mockMap) {
+        doAnswer(invocation -> {
+            mockMap.put(invocation.getArgument(0), invocation.getArgument(1));
+            StoreQueryUtils.updatePosition(innerMock.getPosition(), context);
+            return null;
+        }).when(innerMock).put(any(Bytes.class), any(byte[].class));

Review Comment:
   Ah. My bad. Thanks.



-- 
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