Mockito:
It lets you write beautiful tests with clean & simple API.
Mockito tests are very readable and they produce clean verification errors.
Some features:
1.) Mocks concrete classes as well as interfaces
2.) Little annotation syntax sugar - @Mock
3.) Verification errors are clean - click on stack trace to see failed verification in test; click on exception's cause to navigate to actual interaction in code. Stack trace is always clean.
4.) Allows flexible verification in order (e.g: verify in order what you want, not every single interaction)
5.) Supports exact-number-of-times and at-least-once verification
6.) Flexible verification or stubbing using argument matchers (anyObject(), anyString() or refEq() for reflection-based equality matching)
7.) Allows creating custom argument matchers or using existing hamcrest matchers
Distribution:
Single-jar distribution includes cglib, objenesis and source code
Zip distribution contains all jars, javadoc and source code
1.) Mocks concrete classes as well as interfaces
2.) Little annotation syntax sugar - @Mock
3.) Verification errors are clean - click on stack trace to see failed verification in test; click on exception's cause to navigate to actual interaction in code. Stack trace is always clean.
4.) Allows flexible verification in order (e.g: verify in order what you want, not every single interaction)
5.) Supports exact-number-of-times and at-least-once verification
6.) Flexible verification or stubbing using argument matchers (anyObject(), anyString() or refEq() for reflection-based equality matching)
7.) Allows creating custom argument matchers or using existing hamcrest matchers
Distribution:
Single-jar distribution includes cglib, objenesis and source code
Zip distribution contains all jars, javadoc and source code