Open iadcialim opened 4 years ago
I can confirm the issue on functional interfaces.
interface Supply : suspend (Input) -> Output
In tests the stub whenever(supply(input)).thenReturn(output)
will return null
instead of the specified output.
The issue does not appear when the functional interface is declared manually:
interface Supply {
suspend operator fun invoke(input: Input): Output
}
whenever(call.invoke()).thenReturn(Result.success(0)) will return null! Is this an issue of Mockito or this lib?
SO link: https://stackoverflow.com/q/61097992/8258130