
About Mockito
Mockito is a mocking framework for Java unit tests. It lets you create test doubles and check how your code calls them, using a clean and simple API.
What it does
You create mock objects, set the values they should return, and then verify that certain methods were called. The tests are easy to read, and the verification errors are clear when something goes wrong. Mockito is available from the Maven Central repository for Maven, Gradle and other build systems, and the documentation for each version is hosted on javadoc.io.
Key features
- Create mock objects for Java classes
- Set return values for method calls
- Verify that calls happened as expected
- Install through Maven Central
Who it's for
Java developers who write unit tests and want a common mocking library with a large community and many examples.
Pricing and good to know
Mockito is MIT licensed and free to use. Mockito 3.x requires Java 8, and the project has no breaking changes compared with the 2.x series. The GitHub repository has about 15.4k stars.
Highlights
- Create mock objects for Java classes
- Set return values for method calls
- Verify calls made by the code under test
- Install from Maven Central












