Skip to content

Instantly share code, notes, and snippets.

@adam-arold
Created May 7, 2017 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adam-arold/279886ec714a8e37992057acd9848653 to your computer and use it in GitHub Desktop.
Save adam-arold/279886ec714a8e37992057acd9848653 to your computer and use it in GitHub Desktop.
Mockito helper to make `any` work in Kotlin
import org.mockito.Mockito
class MockitoHelper {
companion object {
fun <T> any(): T {
Mockito.any<T>()
return uninitialized()
}
private fun <T> uninitialized(): T = null as T
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment