Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Most popular Mocking framework for unit tests written in Java

License

NotificationsYou must be signed in to change notification settings

mockito/mockito

Repository files navigation

Mockito

Most popular mocking framework for Java

CICoverage StatusMIT License

Release NotesMaven CentralJavadoc

Current version is 5.x

Still on Mockito 1.x? Seewhat's new in Mockito 2!Mockito 3 does not introduce any breaking API changes, but now requires Java 8 over Java 6 for Mockito 2.Mockito 4 removes deprecated API.Mockito 5 switches the default mockmaker to mockito-inline, and now requires Java 11.Only one major version is supported at a time, and changes are not backported to older versions.

Mockito for enterprise

Available as part of theTidelift Subscription.

The maintainers of org.mockito:mockito-core and thousands of other packages are working with Tidelift to delivercommercial support and maintenance for the open source dependencies you use to build your applications. Save time,reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.Learn more.

Development

Mockito publishes every change as a-SNAPSHOT version to a public Sonatype repository. Roughly once a month, wepublish a new minor or patch version to Maven Central. For release automation we useShipkit library,Gradle Nexus Publish Plugin.Fully automated releases are awesome, and you should do that for your libraries, too!See thelatest release notesandlatest documentation. Docs injavadoc.io are available 24h after release. Read alsoaboutsemantic versioning in Mockito.

Older 1.x and 2.x releases are available inCentral Repositoryandjavadoc.io (documentation).

More information

All you want to know about Mockito is hosted atThe Mockito Site which isOpen Source and likespull requests, too.

Want to contribute? Take a look at theContributing Guide.

Enjoy Mockito!

Need help?

How to develop Mockito?

To build locally:

./gradlew build

You can open in any IDE that support Gradle, e.g. IntelliJ IDEA, or Fleet.For Eclipse, one may need to run./gradlew eclipse before importing the project.

How to release new version?

  1. Every change on the main development branch is released as-SNAPSHOT version to Sonatype snapshot repoathttps://s01.oss.sonatype.org/content/repositories/snapshots/org/mockito/mockito-core.

  2. 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.5git push origin v3.4.5
  3. At the moment, youmay not create releases from GitHub Web UI. Doing so will make the CI build fail because theCI creates the changelog and posts to GitHub releases. We'll support this in the future.


[8]ページ先頭

©2009-2025 Movatter.jp