nquinn
03/26/2017, 4:32 PMfun <T> OngoingStubbing<Deferred<T>>.thenDeferred(value: T) : OngoingStubbing<Deferred<T>> {
return thenReturn( async(CommonPool) { value })
}
whenever( mockConnection.updateWithParams(sql, params)).thenDeferred(UpdateResult())
returns something i can .await() on just fine, but if I make the signature of the suspend fun updateWithParams(…): UpdateResult vs fun updatedWithParams(..): Deferred<UpdateResult>, I always get null as a result to the mocked function
3 replies
I don’t believe that open is necessary on an interface, and it isn’t required for any of my other Kotlin interfaces that aren’t suspending functions that return types