samarth-ksolves commented on code in PR #20353:
URL: https://github.com/apache/kafka/pull/20353#discussion_r2377955353


##########
streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueBytesStoreTest.java:
##########
@@ -112,28 +208,59 @@ public void after() {
 
     @Test
     public void shouldDelegateInit() {
-        final InternalMockProcessorContext context = mockContext();
-        final KeyValueStore<Bytes, byte[]> innerMock = 
mock(InMemoryKeyValueStore.class);
+        final InternalMockProcessorContext mockContext = mockContext();
         final StateStore outer = new 
ChangeLoggingKeyValueBytesStore(innerMock);
-        outer.init(context, outer);
-        verify(innerMock).init(context, outer);
+        outer.init(mockContext, outer);
+        verify(innerMock).init(mockContext, outer);
+    }
+
+    @Test
+    public void shouldWriteKeyValuePairBytesToInnerStoreOnPut() {
+        final Map<Bytes, byte[]> mockMap = new HashMap<>();
+        mockPut(mockMap);
+        mockGet(mockMap);
+        mockPosition();
+
+        store.put(hi, there);

Review Comment:
   @zheguang As per my understanding, the concern about collector being reused 
across tests does not apply here. In JUnit 5, the default lifecycle is 
PER_METHOD, which creates a new test class instance for each test method. Since 
collector is a final instance field, a fresh MockRecordCollector is 
instantiated per test execution. This ensures test isolation and avoids state 
leakage across tests. Additional reset logic would only be necessary if the 
lifecycle were explicitly changed to PER_CLASS.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to