[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7389":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},7389,"mockito-kotlin","mockito\u002Fmockito-kotlin","mockito","Using Mockito with Kotlin","",null,"Kotlin",3172,207,38,78,0,4,28.95,"MIT License",false,"main",true,[24,7,5],"kotlin","2026-06-12 02:01:38","# Mockito-Kotlin\n\n[![Maven Central Version](https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Forg.mockito.kotlin\u002Fmockito-kotlin)](https:\u002F\u002Fcentral.sonatype.com\u002Fartifact\u002Forg.mockito.kotlin\u002Fmockito-kotlin)\n\nA small library that provides helper functions to work with [Mockito](https:\u002F\u002Fgithub.com\u002Fmockito\u002Fmockito) in Kotlin.\n\n## Install\n\nMockito-Kotlin is available on Maven Central.\nFor Gradle users, add the following to your build file, replacing `x.x.x` with the latest version:\n\n`build.gradle`:\n```groovy\ntestImplementation \"org.mockito.kotlin:mockito-kotlin:x.x.x\"\n```\n\n`build.gradle.kts`:\n```kotlin\ntestImplementation(\"org.mockito.kotlin:mockito-kotlin:x.x.x\")\n```\n\n## Example\n\nA test using Mockito-Kotlin typically looks like the following:\n\n```kotlin\n@Test\nfun doAction_doesSomething(){ \n  \u002F* Given *\u002F\n  val mock = mock\u003CMyClass> {\n    on { getText() } doReturn \"text\"\n  }\n  val classUnderTest = ClassUnderTest(mock)\n  \n  \u002F* When *\u002F\n  classUnderTest.doAction()\n  \n  \u002F* Then *\u002F\n  verify(mock).doSomething(any())\n}\n```\n\nFor more info and samples, see the [Wiki](https:\u002F\u002Fgithub.com\u002Fmockito\u002Fmockito-kotlin\u002Fwiki).\n\n## Android Support\n\nSee the [Android Support wiki](https:\u002F\u002Fgithub.com\u002Fmockito\u002Fmockito-kotlin\u002Fwiki\u002FAndroid-Support).\n\n## Building\n\nMockito-Kotlin is built with Gradle.\n\n - `.\u002Fgradlew build` builds and tests the project\n - `.\u002Fgradlew publishToMavenLocal` installs the maven artifacts in your local repository\n - `.\u002Fgradlew check` runs the test suite (See Testing below)\n\n### Versioning\n\nMockito-Kotlin roughly follows SEMVER\n\n### Testing\n\nMockito-Kotlin's test suite is located in a separate `tests` module,\nto allow running the tests using several Kotlin versions whilst still\nkeeping the base module at a recent version.\n\n - `.\u002Fgradlew check` runs the checks including tests.\n\nUsually it is enough to test only using the default Kotlin versions;\nCI will test against multiple versions.\nIf you want to test using a different Kotlin version locally,\nadd the `-PtestKotlinVersion=1.2.3` argument to the Gradle invocation while running the tests.\n\n### Acknowledgements\n\n`mockito-kotlin` was created and developed by [nhaarman@](https:\u002F\u002Fgithub.com\u002Fnhaarman) after which the repository was integrated into the official Mockito GitHub organization.\nWe would like to thank Niek for the original idea and extensive work plus support that went into `mockito-kotlin`.\n","mockito-kotlin 是一个轻量级库，旨在为 Kotlin 项目提供与 Mockito 框架更顺畅的集成体验。它通过提供一系列辅助函数简化了在 Kotlin 中使用 Mockito 的过程，使得创建 mock 对象、设置行为及验证交互变得更加直观和简洁。该库特别适合那些希望利用 Mockito 强大的单元测试能力同时又偏好或正在使用 Kotlin 语言进行开发的团队和个人。无论是普通的 Java\u002FKotlin 应用还是 Android 项目，当需要进行依赖注入相关的测试时，mockito-kotlin 都能发挥重要作用。",2,"2026-06-11 03:12:05","top_language"]