OSS Tanbou

Mockito — Java mocking for focused unit tests, stubbing, and interaction verification

OSS health 79
About these scores

Discovery score is an unbounded weighted, log-compressed index of stars, watchers, forks, and contributors. Growth momentum is its change over the observed period; OSS health is a 0–100 score from available repository recency, Community Health, and release data.

Stars
15,455
Primary language
Java
License
MIT
Repository last updated
Sep 9, 2026

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.

Sources: [2][4]

Official sources

  1. [1]mockito/mockito — GitHub repository metadata(2026-09-17)
  2. [2]Mockito — README(2026-09-17)
  3. [3]Mockito — Byte Buddy based MockMaker implementation(2026-09-17)
  4. [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. 1

    Get the source

    git clone --depth 1 https://github.com/mockito/mockito.git
  2. 2

    Enter the repository

    cd mockito
  3. 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
Check the official README

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

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
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.