Matteo Mirk
09/20/2022, 9:12 AMmockkConstructor()
on the superclass and then stub with anyConstructed()
, but it didn’t work.
Is this even possible to achieve with Mockk? The docs don’t say anything about this scenario.Mattia Tommasone
09/20/2022, 9:13 AMMatteo Mirk
09/20/2022, 9:15 AMopen suspend fun
. It’s overridden in the subclass and calls the super before doing other stuff. For this test I need to stub it, but can’t find a way.Mattia Tommasone
09/20/2022, 9:16 AMsuper()
call and have the subclass function invoke the real function?ùMattia Tommasone
09/20/2022, 9:16 AMMatteo Mirk
09/20/2022, 9:22 AMMattia Tommasone
09/20/2022, 9:24 AManyConstructed
will match constructors being called when instantiating a superclass with super
I’m guessing it will, but it’s an educated guessMattia Tommasone
09/20/2022, 9:24 AMMatteo Mirk
09/20/2022, 9:28 AMcoEvery { underTest["execute"](request) }
so that’s the route I’ll have to go down; in the near future we will get rid of inheritance using a decorator and this problem will disappear.
Big thanks anyway for the support Mattia! 🙌