# Mockito

> Tasty mocking framework for unit tests in Java

Source: https://talira.ai/catalog/mockito-19c1938g
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / testing / mocking](https://talira.ai/categories/developer-tools/testing/mocking), [languages / java](https://talira.ai/categories/languages/java)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Mockito](https://talira.ai/orgs/mockito.md)

Mockito is a mocking framework for unit tests in Java and other JVM languages. You create mocks and spies of your classes and interfaces, stub what their methods return, and verify how they were called, with a clean, readable API and clear verification errors. It's published on Maven Central as mockito-core, with mockito-junit-jupiter for JUnit 5 integration, and released automatically by continuous delivery.

## Links

- Website: https://site.mockito.org/
- GitHub: https://github.com/mockito/mockito
- Docs: https://javadoc.io/doc/org.mockito/mockito-core

## Problems it solves

- replace a database or HTTP client with a fake in my Java unit tests
- check that my code called a dependency with the right arguments
- stub what a dependency returns so I can test one class in isolation
- mock collaborators in JUnit 5 tests with annotations instead of setup code

## Features

- mocks and spies of classes and interfaces
- stubbing return values and exceptions
- verification of calls, arguments and call counts
- argument matchers and captors
- JUnit 5 integration with mockito-junit-jupiter
- @Mock, @Spy and @InjectMocks annotations

## Trust

Overall: 0.65 out of 1.
Signals: maintenance 0.80, adoption 0.84, momentum 0.59, community 1.00, backing 0.30, extensibility 0.00.

- last commit 18 days ago
- 30 commits in the last 90 days
- latest release v5.24.0 2 months ago
- 15.5k GitHub stars
- 355 contributors
- accepts sponsorship (Tidelift)
- has a company behind it

## Sources

[^1]: https://github.com/mockito/mockito/blob/main/LICENSE (checked 24 Nov 2026)
