@Paul Woitaschek willReturn() declares what your mock function call will return. But I faced several issues with Mockito in Kotlin (I don't use kotlin-mockito) with exceptions inside Mockito when I used willReturn(). So it's better to use doReturn(val).`when`(mock_obj).function_name(params)