Mockito logo

Mockito

Most popular mocking framework for Java/Kotlin, providing readable stub/verify syntax and an inline byte-code-manipulating mock-maker for final classes.

-

Our Verdict

The obvious default for Java mocking, with the usual caveat that over-mocking hurts design.

Pros

  • De facto standard for JVM mocking
  • Readable when().thenReturn() stub/verify syntax
  • Inline mock-maker handles finals and statics
  • Massive community, docs and Stack Overflow coverage

Cons

  • Encourages over-mocking if used carelessly
  • Static and final mocking can be footgun-heavy
  • Kotlin ergonomics less pleasant than MockK
  • Bytecode manipulation can clash with agents
Best for: Java teams doing any real unit testing on non-trivial codebases Not for: Kotlin-first teams who will be happier with MockK

When to Use Mockito

Good fit if you need

  • Stub and verify Java/Kotlin service dependencies
  • Inline mock-maker for mocking final classes and methods
  • Argument captors for inspecting method call parameters
  • Spy on real objects while stubbing specific methods

Mockito Pricing

Pricing Model
free
Free Tier
Yes
Entry Price
β€”
Enterprise Available
No
Transparency Score
β€”

Beta β€” estimates may differ from actual pricing

1,000
1001K10K100K1M

Estimated Monthly Cost

$25

Estimated Annual Cost

$300

Estimates are approximate and may not reflect current pricing. Always check the official pricing page.

Project Health

A

Health Score

15.4k 2.7k
Bus Factor

10

Last Commit

4 days

Release Freq

52d

Open Issues

481

Issue Response

N/A

License

MIT

Last checked: 2026-04-21

Lock-in Assessment

High 5/5
Lock-in Score
5/5

πŸ”„ Thinking about migrating off Mockito?

Get an AI-drafted migration plan + a copy-paste email to Mockito support requesting a data export. Pick where you're moving to and tell us your context.

Looking for alternatives to Mockito?

Answer 4 quick questions β€” get an AI-ranked shortlist of tools that match your stack and requirements.

Open AI Tool Finder

Community Discussion

Comments powered by Giscus (GitHub Discussions). You need a GitHub account to comment.