import org.mockito.Mockito.`when` as whenever
3 months of Kotlin, code review summary
Elye
6056

You can also make use of this library https://github.com/nhaarman/mockito-kotlin

Usage
https://github.com/nhaarman/mockito-kotlin/wiki/Mocking-and-verifying

This can get rid of these imports

Now your mocking mechanism will be

val mock : MyClass = mock()

Note the work of smart casting here

Also it has whenever method which you can use

whenever(mock.stringValue()).thenReturn("test")
Show your support

Clapping shows how much you appreciated Kishan B’s story.