You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ca...@apache.org on 2022/06/24 10:19:33 UTC

[kafka] branch trunk updated: HOTFIX: Fix NPE in StreamTask#shouldCheckpointState (#12341)

This is an automated email from the ASF dual-hosted git repository.

cadonna pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 08e27914cc HOTFIX: Fix NPE in StreamTask#shouldCheckpointState (#12341)
08e27914cc is described below

commit 08e27914ccf492e32c7fff652f32236b2dce8928
Author: Bruno Cadonna <ca...@apache.org>
AuthorDate: Fri Jun 24 12:19:22 2022 +0200

    HOTFIX: Fix NPE in StreamTask#shouldCheckpointState (#12341)
    
    The mocks were not setup correctly in StreamTask#shouldCheckpointState
    which caused a null pointer exception during test execution.
---
 .../org/apache/kafka/streams/processor/internals/StreamTaskTest.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java b/streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java
index 2fb87a5ae9..3f9a2cbffd 100644
--- a/streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java
@@ -1951,7 +1951,9 @@ public class StreamTaskTest {
         EasyMock.expectLastCall().once();
         stateManager.checkpoint();
         EasyMock.expectLastCall().once();
-        EasyMock.replay(stateManager);
+        EasyMock.expect(stateManager.changelogOffsets()).andStubReturn(Collections.emptyMap());
+        EasyMock.expect(recordCollector.offsets()).andStubReturn(Collections.emptyMap());
+        EasyMock.replay(stateManager, recordCollector);
 
         task = createOptimizedStatefulTask(createConfig("100"), consumer);