There is such a method, it makes a request through VKApi and gets the user's avatar id
private fun getPhotoIdByUser(userId: String) { val fields = "crop_photo" val request = VKApi.users().get(VKParameters.from(VKApiConst.USER_ID, userId, VKApiConst.COUNT, 1, VKApiConst.FIELDS, fields)) request.executeWithListener(object : VKRequest.VKRequestListener() { override fun onComplete(response: VKResponse?) { val id = response?.json?.getJSONArray("response") ?.getJSONObject(0)?.getJSONObject("crop_photo") ?.getJSONObject("photo")?.getString("id") } override fun onError(error: VKError?) { Log.e("tag", "error") } }) } I know what id should come back. But how to compare the actual result with the expected result if the method returns nothing? Is it possible to do something with the method so that testing becomes possible?