| commit | feaf63e2ea38828b25dd23bf34a8128aefe0d50b | [log] [tgz] |
|---|---|---|
| author | Niek Haarman <haarman.niek@gmail.com> | Fri Jul 05 14:39:15 2019 +0200 |
| committer | Niek Haarman <haarman.niek@gmail.com> | Fri Jul 05 14:40:48 2019 +0200 |
| tree | a4c223c3e6673b246a28b0bdd57dea4c5bcb10e5 | |
| parent | 4779b29d3fe670e82f358eec8e8daf12e95d8004 [diff] |
Make after() return type non-null
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.