Most popular mocking framework for Java
- what's new | Mockito 2
- requirements
- Java v6+
- requirements
- Mockito 3
- NOT breaking API changes
- requirements
- Java v8+
- Mockito 4
- removes deprecated API
- Mockito 5
- default
mockmaker
-- is replaced by --mockito-inline
- changes are NOT backward compatible
- requirements
- Java v11+
- default
- Tidelift Subscription
- run by
- maintainers of
org.mockito:mockito-core
- maintainers of
- benefits
- Save time
- reduce risk
- improve code health
- pay on demand the exact dependencies / you use
- Learn more.
-SNAPSHOT
version- published | public Sonatype repository
- new minor or patch version
- published / month | Maven Central
- Shipkit & Gradle Nexus Publish Plugin
- uses
- release automation
- uses
- latest release notes
- latest documentation
- semantic versioning in Mockito
- Older 1.x and 2.x
- releases are available | Central Repository &
- javadoc.io documentation
All you want to know about Mockito is hosted at The Mockito Site which is Open Source and likes pull requests, too.
Want to contribute? Take a look at the Contributing Guide.
Enjoy Mockito!
- Search / Ask question on stackoverflow
- Go to the mockito mailing-list (moderated)
- Open a ticket in GitHub issue tracker
./gradlew build
- build locally
- if you are using IntelliJ IDEA -> you can
- use built-in Gradle import wizard | IDEA
./gradlew idea
- -- generate the -- importable IDEA metadata files
- open the generated "*.ipr" | IDEA
- Every change on the main development branch is released as
-SNAPSHOT
version to Sonatype snapshot repo at https://s01.oss.sonatype.org/content/repositories/snapshots/org/mockito/mockito-core. - In order to release a non-snapshot version to Maven Central push an annotated tag, for example:
git tag -a -m "Release 3.4.5" v3.4.5
git push origin v3.4.5
- At the moment, you may not create releases from GitHub Web UI. Doing so will make the CI build fail because the CI creates the changelog and posts to GitHub releases. We'll support this in the future.