guozhangwang commented on a change in pull request #8964:
URL: https://github.com/apache/kafka/pull/8964#discussion_r468793170
##########
File path:
streams/src/test/java/org/apache/kafka/streams/processor/internals/StandbyTaskTest.java
##########
@@ -207,15 +207,25 @@ public void
shouldFlushAndCheckpointStateManagerOnCommit() {
EasyMock.expect(stateManager.changelogOffsets()).andStubReturn(Collections.emptyMap());
stateManager.flush();
EasyMock.expectLastCall();
- stateManager.checkpoint(EasyMock.eq(Collections.emptyMap()));
-
EasyMock.expect(stateManager.changelogOffsets()).andReturn(Collections.singletonMap(partition,
50L));
+ stateManager.checkpoint();
+ EasyMock.expectLastCall();
+ EasyMock.expect(stateManager.changelogOffsets())
+ .andReturn(Collections.singletonMap(partition, 50L))
+ .andReturn(Collections.singletonMap(partition, 11000L))
+ .andReturn(Collections.singletonMap(partition, 11000L));
EasyMock.expect(stateManager.changelogPartitions()).andReturn(Collections.singleton(partition)).anyTimes();
EasyMock.replay(stateManager);
task = createStandbyTask();
task.initializeIfNeeded();
task.prepareCommit();
- task.postCommit();
+ task.postCommit(false); // this should not checkpoint
Review comment:
Yeah I tried to mock the static `checkpointNeeded` but it seems not
possible with easy-mock.
----------------------------------------------------------------
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:
[email protected]