commit | 1ba5701ef803644ae1f6da289737943f62945776 | [log] [tgz] |
---|---|---|
author | Martin Brandtner <martin.brandtner@ergon.ch> | Mon Sep 03 17:11:37 2018 +0200 |
committer | Martin Brandtner <martin.brandtner@ergon.ch> | Mon Sep 03 17:11:37 2018 +0200 |
tree | eeba330dee27ec8b341bf3dae9ca1e32ec67111f | |
parent | a0f787528b665c3c58945c9f54eeda5be546a9b4 [diff] |
Bump mockito to version 2.21.0
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:
testCompile "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.