cadonna commented on code in PR #12524:
URL: https://github.com/apache/kafka/pull/12524#discussion_r984341403
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/StandbyTaskTest.java:
##########
@@ -313,36 +282,29 @@ public void shouldNotFlushAndThrowOnCloseDirty() {
final double expectedCloseTaskMetric = 1.0;
verifyCloseTaskMetric(expectedCloseTaskMetric, streamsMetrics,
metricName);
-
- EasyMock.verify(stateManager);
}
@Test
public void shouldNotThrowFromStateManagerCloseInCloseDirty() {
-
EasyMock.expect(stateManager.changelogOffsets()).andStubReturn(Collections.emptyMap());
- stateManager.close();
- EasyMock.expectLastCall().andThrow(new
RuntimeException("KABOOM!")).anyTimes();
- EasyMock.replay(stateManager);
+ doThrow(new RuntimeException("KABOOM!")).when(stateManager).close();
task = createStandbyTask();
task.initializeIfNeeded();
task.suspend();
task.closeDirty();
- EasyMock.verify(stateManager);
+ verify(stateManager, atLeastOnce()).close();
}
@Test
public void shouldSuspendAndCommitBeforeCloseClean() {
Review Comment:
Actually, my comment is on line 305, i.e., method
`shouldSuspendAndCommitBeforeCloseClean()` and not
`shouldNotThrowFromStateManagerCloseInCloseDirty()`. I think there you should
verify that `stateManager.checkpoint` is called before `stateManager.close()`.
But since the current test does also not check the order and this PR is about
migration, you can consider this an optional request.
--
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]