When to use Mockito.verify()?
问题 I write jUnit test cases for 3 purposes: To ensure that my code satisfies all of the required functionality, under all (or most of) the input combinations/values. To ensure that I can change the implementation, and rely on JUnit test cases to tell me that all my functionality is still satisfied. As a documentation of all the use cases my code handles, and act as a spec for refactoring - should the code ever need to be rewritten. (Refactor the code, and if my jUnit tests fail - you probably