Github user JoshRosen commented on the pull request:
https://github.com/apache/spark/pull/4578#issuecomment-74171782
It would be helpful if reviewers could help me to confirm that I haven't
changed the semantics of these tests. One major difference between EasyMock
and Mockito seems to be in how they handle calls to non-stubbed methods. I
think that EasyMock will throw exceptions if non-mocked methods are called,
whereas Mockito will return a default value based on the method's return type
([source](http://docs.mockito.googlecode.com/hg/1.9.5/org/mockito/internal/stubbing/defaultanswers/ReturnsEmptyValues.html)).
It looks like we could use Mockito's
[verifyNoMoreInteractions()](http://docs.mockito.googlecode.com/hg/1.9.5/org/mockito/Mockito.html#finding_redundant_invocations)
to assert that only explicitly expected method calls took place. Given that
our original tests were written with EasyMock-style semantics, I'm going to add
`verifyNoMoreInteractions(...)` to our `after()` methods so that it's clearer
that we've properly preserved the old test semantics.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]