Mattia Tommasone
Mattia Tommasone
The fact that you mention that lowering the language version to below 1.5 makes me think this is due to the change introduced in 1.5.0 about SAM interfaces: https://kotlinlang.org/docs/whatsnew15.html#sam-adapters-via-invokedynamic
Is your `getApiToken` polymorphic, by any chance? I'm guessing the spy internally calls the three parameter version and this is messing up with the verification process.
Oh, it's a suspend function, so the third parameter is likely the continuation added under the hood by the kotlin compiler. Still, what you're experiencing is definitely a weird behavior....
Right, makes sense.
Can you please make sure this builds with earlier JDK versions and not just with 17? Thanks
@pavlo-tr, sorry for the late reply. Given that I kind of understand the issue you are speaking about here, I don't really understand what you are trying to test here....
Yep I see what you mean, the thing is that inside an `every` block mockk actually uses the stubbed methods, if any, which is why your call to `document.latestVersion()` inside...
It is indeed a weird behavior 😅 I've been debugging your example as well, and noticed that outside of the `every { processVersion(document.latestVersion)) }` block, `document.versions` is indeed populated, while...
Yep you're right, it shouldn't be stale. I don't have time to work on it personally ATM, but I'd gladly review a PR updating the docs with some further details...
This should just be a matter of detecting if a method is being called on a constructed object without having an answer defined and throwing an exception accordingly.