waqas
10/23/2017, 2:44 PMannyce
10/23/2017, 2:45 PMwaqas
10/23/2017, 2:49 PMUsing Mockito-Kotlin
There’s a library <https://github.com/nhaarman/mockito-kotlin> which seems to address the Non-null issue. Great!! … But… that only works for parameter that have default constructor.
waqas
10/23/2017, 2:53 PM?:
, so that it;s not null. And asserts will fail anyhow because size and other stuff won't match from empty list.annyce
10/23/2017, 3:03 PMwaqas
10/23/2017, 3:05 PMprivate fun <T> any(): T {
Mockito.any<T>()
return uninitialized()
}
private fun <T> uninitialized(): T = null as T