commit | 52f879a6b9706039b1f9979b8f845183983543eb | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Mon Oct 29 21:49:17 2018 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Mon Oct 29 21:49:17 2018 +0100 |
tree | b911f3777a345c2d3c3659610d49d10f487fd118 | |
parent | ab88f799f23be28be758abc9502581a8ca986f1c [diff] |
Update Android maven plugin to 2.1
A small library that provides helper functions to work with Mockito in Kotlin.
Mockito-Kotlin is available on Maven Central and JCenter. For Gradle users, add the following to your build.gradle
, replacing x.x.x
with the latest version:
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:x.x.x"
A test using Mockito-Kotlin typically looks like the following:
@Test fun doAction_doesSomething(){ /* 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.