commit | 8e083adda1c2b2a49a76e8f2c4db990867cadcb6 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Thu Oct 20 22:52:33 2016 +0200 |
committer | Niek Haarman <haarman.niek@gmail.com> | Fri Oct 21 22:10:05 2016 +0200 |
tree | e928ae3e1aa41861dfa7f3fdd9cbe2d3ae2fb9ef | |
parent | 5878bbe790ba54b93436b7dd55e852728a6cee11 [diff] |
Publish to Maven Central instead of Bintray
A small library that provides helper functions to work with Mockito in Kotlin.
Mockito-Kotlin is available on Maven Central. For Gradle users, add the following to your build.gradle
, replacing x.x.x
with the latest version:
repositories { mavenCentral() } dependencies { testCompile "com.nhaarman:mockito-kotlin:x.x.x" }
A test using Mockito-Kotlin typically looks like the following:
@Test fun a(){ /* Given */ val mock = mock<MyClass> { on { getText() } doReturn "text" } val classUnderTest = ClassUnderTest(mock) /* When */ classUnderTest.doAction() /* Then */ verify(mock).doSomething(any()) }
For more info and samples, see the Wiki.