Overview
Mockito is a Java mocking framework for replacing dependencies in unit tests, stubbing responses, and verifying interactions. Mockito 5 uses the inline mock maker by default and requires Java 11 or newer. The latest GitHub release checked on September 17, 2026 is v5.23.0.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Keep tests focused by replacing dependencies with mocks
Mocks let tests isolate collaborators such as database clients or external services, stub only the behavior needed for a scenario, and verify expected method interactions.
Sources: [2]
Use Byte Buddy-based mock makers with an extension point for JVM environments
The default implementation uses Byte Buddy, ASM, and Objenesis, while the MockMaker extension point allows alternate mock-generation strategies.
Sources: [3]
For Java services that need fast unit tests around collaboration behavior
Mockito is useful when teams want to test code with many collaborators without starting the external systems behind those collaborators.
Sources: [2]
Avoid over-mocking and check runtime requirements
Tests that verify implementation details too aggressively can become brittle during refactoring. Mockito supports one major version at a time, Mockito 5 requires Java 11+, and v5.23.0 introduced an Android breaking change requiring API 28+ devices or emulators for mockito-android tests.
Official sources
- [1]mockito/mockito — GitHub repository metadata(2026-09-17)
- [2]Mockito — README(2026-09-17)
- [3]Mockito — Byte Buddy based MockMaker implementation(2026-09-17)
- [4]Mockito v5.23.0 release(2026-09-17)
Supplemental curator note
The entry covers both the surface API and the mock-maker/runtime constraints that matter when adopting Mockito.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/mockito/mockito.git - 2
Enter the repository
cd mockito - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
15,455 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 2
- Open PRs
- 42
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- mockito
- java
- mocking-framework
- testing-tools
- mocking
- mock
- mocks
- testing
- test-automation
- test-driven-development
- mock-library
- java-library
- Stars
- 15,455
- Forks
- 2,667
- Watchers
- 414
- Open issues
- 451
- Primary language
- Java
- License
- MIT
- Repository last updated
- Sep 9, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- React250,526 Stars
A JavaScript library for building web and native user interfaces from declarative components.
JavaScript - Visual Studio Code (Code - OSS)192,608 Stars
The MIT-licensed Code - OSS repository that forms the open foundation of Visual Studio Code.
TypeScript - Flutter178,980 Stars
A BSD-3-Clause cross-platform SDK for building mobile, web, and desktop UIs from a Dart codebase.
Dart - Bootstrap174,828 Stars
A responsive, mobile-first web framework built from CSS and JavaScript grids, utilities, and components.
MDX - LangChain146,506 Stars
A Python framework that connects models, tools, retrieval systems, and other components for LLM applications and agents.
Python
Report incorrect information
Tell us if any listing information is incorrect or outdated.