dan.the.man
08/21/2022, 9:38 PMJacob
08/21/2022, 9:58 PMdan.the.man
08/21/2022, 10:02 PMRepo
which only has Api
as a dependency of it.
lateinit var repo: Repo
lateinit var vm: VM
repo = mock {onblocking{this.myApiCall()}.thenReturn(result)
vm = VM(repo)
vm.doMethod()
This results in a NPE where
open class Repo(api:Api){
fun myApiCall(){
val apiResult = api.makeCall() //Results in NPE
But I would expect for the mock to intercept this and instead just return the value I specifiedApi
then I'm seeing the correct behavior