Most of the times while stubbing with Mockito or MockK you will use doReturn construction. But do you know, that you can stub your test double method in other way – with doAnswer. Let's take a look a both stubbing types.
How to easily stub or mock suspend function in Kotlin? MockK is the solution. See MockK examples for mocking coroutines.