jeff303 edited a comment on pull request #11792: URL: https://github.com/apache/kafka/pull/11792#issuecomment-1078447241
Something I've learned, that I feel is not adequately covered by [this wiki](https://github.com/mockito/mockito/wiki/Mockito-vs-EasyMock): EasyMock expectations seem to stack up, as you build them. Or perhaps more like a FIFO queue. Expectations are queued up, then as invocations happen, the front of the queue is removed to satisfy the invocation, and the next mock is moved to the front. On the other hand, Mockito only seems to have a **single** current mock behavior for a particular set of argument matchers. This means that new expectations can't be set until after the actual code exercises the first one (ex: the calls to `expectRebalance` in our tests). Because EasyMock is broken into phases, it allows for the "stacking" of those expectations in one phase, followed by execution, followed by verification. But with Mockito, it's necessary to follow a more staggered approach (set expectation, exercise code, set new expectation, exercise again, verify at end). Just an observation for anyone else (or myself) in the future that is hopefully useful. -- 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