# Mockito

Most popular Mocking framework for unit tests written in Java

Repository: https://github.com/mockito/mockito
Canonical: https://ross.abutalabs.com/products/mockito
Homepage: http://mockito.org
Language: Java
License: MIT
License Family: permissive
Topics: mockito, java, mocking-framework, testing-tools, mocking, mock, mocks, testing, test-automation, test-driven-development, mock-library, java-library
Last push: 2026-08-10T18:54:33+00:00
Link (homepage): http://mockito.org

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 74, longevity 100
- inputs: {"age_days": 5072, "days_push": 23, "days_rel": 175, "gap_med": 27.5, "n_releases_24m": 15}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 15448, forks 2666 (observed 2026-08-28T04:11:09.850793+00:00)

## What it is
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
- artifact type: library
- maturity: stable
- function: mocking, testing
- domain: testing, developer-tools
- platform: jvm
- tags: unit-testing, test-doubles, tdd, mockito-kotlin, java-library, jvm

## Member repositories
- mockito/mockito (main) score 90
- mockito/mockito-kotlin (sdk) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:09.850793+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:05:51.156533+00:00, confidence not recorded.
  - readme: https://github.com/mockito/mockito (fetched 2026-08-28T04:11:09.850793+00:00, sha cf80227da847)
  - homepage: http://mockito.org (fetched 2026-08-29T08:03:57.895390+00:00, sha bd08c4ce53cb)
- Data as of 2026-08-30T08:39:29.467469+00:00.
