Mockito
Most popular Mocking framework for unit tests written in Java observed · 2026-08-28
Health v2 · maintenance only
90/100
- Activity 97
- Release rhythm 74
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 27.5
- age_days: 5072
- days_rel: 175
- days_push: 23
- n_releases_24m: 15
Adoption not part of the score
15448 stars · 2666 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
Mockito is the most popular mocking framework for unit tests written in Java, with a clean API for creating test doubles and verifying interactions. A companion mockito-kotlin library provides idiomatic Kotlin support.
Use cases
- mock dependencies in java unit tests
- create test doubles for junit tests
- verify method calls in tests
- stub method return values in java
- write tdd-style tests with mocks
- mock kotlin classes in tests
When to choose
- you write unit tests in Java or Kotlin on the JVM
- you need to isolate classes from their dependencies in tests
- you want a mature, widely-documented mocking library with strong IDE and build-tool support
When to avoid
- you are testing outside the JVM ecosystem
- you prefer integration tests over isolated unit tests with mocks
- you need a different test-double style like contract testing
Facets
library · maturity stable
mocking testing testing developer-tools jvm unit-testing test-doubles tdd mockito-kotlin java-library jvm
2 sources
- readme: https://github.com/mockito/mockito · fetched 2026-08-28 · cf80227da847
- homepage: http://mockito.org · fetched 2026-08-29 · bd08c4ce53cb
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| mockito/mockito | main | 90 |
| mockito/mockito-kotlin | sdk | 84 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem