java单元测试面试_Mockito一个采用Java编写用于单元测试的Mocking框架

d63f959677a4bad7d3a2bc64c98224ee.png

Most popular mocking framework for Java

68747470733a2f2f7472617669732d63692e6f72672f6d6f636b69746f2f6d6f636b69746f2e7376673f6272616e63683d72656c656173652f332e7868747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6d6f636b69746f2f6d6f636b69746f2e73766768747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72656c656173652532306e6f7465732d332e782d79656c6c6f772e73766768747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f6f72672e6d6f636b69746f2f6d6f636b69746f2d636f72652e73766768747470733a2f2f696d672e736869656c64732e696f2f62696e747261792f762f6d6f636b69746f2f6d6176656e2f6d6f636b69746f2d646576656c6f706d656e7468747470733a2f2f7777772e6a617661646f632e696f2f62616467652f6f72672e6d6f636b69746f2f6d6f636b69746f2d636f72652e737667

Current version is 3.x

Still on Mockito 1.x? See what'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 for enterprise

Available as part of the Tidelift Subscription

The maintainers of org.mockito:mockito-core and thousands of other packages are working with Tidelift to deliver commercial 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 continuously delivers improvements using Shipkit library (http://shipkit.org). See the latest release notes and latest documentation. Docs in javadoc.io are available 24h after release. Read also about semantic versioning in Mockito. Note: not every version is published to Maven Central.

Older 1.x and 2.x releases are available in Central Repository , Bintray and javadoc.io (documentation).

More information

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!

Need help?

Search / Ask question on stackoverflow

Go to the mockito mailing-list (moderated)

Open a ticket in GitHub issue tracker

How to develop Mockito?

To build locally:

./gradlew build

To develop in IntelliJ IDEA you can use built-in Gradle import wizard in IDEA. Alternatively generate the importable IDEA metadata files using:

./gradlew idea

Then, open the generated *.ipr file in IDEA.

How to release new version?

Mockito implements Continuous Delivery model. Every change on main branch (for example merging a pull request) triggers a release build on Travis CI. The build publishes new version if specific criteria are met: all tests green, no 'ci skip release' used in commit message, see the build log for more information. Every new version is published to "mockito/maven" Bintray repository. New versions that Mockito team deems "notable" are additionally published to Maven Central and JCenter. We used to publish every version to Maven Central but we changed this strategy based on feedback from the community (#911).

Q: What's new in Mockito release model?

A: In Q2 2017 we implemented Mockito Continuous Delivery Pipeline 2.0. Not every version is published to Maven Central.

Q: How to publish to Maven Central?

A: Include "[ci maven-central-release]" in the merge commit when merging the PR. Hint: To signify a new feature consider updating version to next minor/major, like: "2.8.0", "2.9.0", "3.0.0".

Q: How to promote already released version to a notable version?

A: It isn't automated at the moment. What's the use case?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值