every { mockedService.realMethod( // match the first argument value: match { "something" == it.firstArgument }, // the second argument will be a called within answer captureLambda<(String)->Unit>(), ) } answers { // invoke the passed lambda as the real service would do: lastArg<(String)->Unit>().invoke("lambda argument to call with") "returned real method answer here" }define a function like this: fun performWork(param1: String, myCallback: (result: String?) -> Unit) { // perform some network work // on network finished myCallback.invoke("result from network") } use like this: performWork("http://..."){ result -> //use result }