<@U7TJY2ZD3> hello, could we specify the target of...
# mockk
a
@oleksiyp hello, could we specify the target of the @Mockk annotation, like @field:Mockk ? Will Mockk work correctly ?
We use to Toothpick as DI framework
And TP use reflexion to find which dependencies has to be mocked (with getDeclaredField in Java)
in standard, Mockk use the property target, so TP do not get the field.
@oleksiyp had you any chance to see my question ?
o
Hi, Ive seen, but not very experienced with this annotations and dont have an answer
a
I’m not too...,however it does mean that mockk works differently that mockito and others which create mocks that are accessible by fields
so to make it running, we have to both annotante @Mockk and @field:Mockk (for toothpick)
@oleksiyp I’m still on that issue, I create a issue about TP, with an example to helping us in finding a solution
@oleksiyp did you had a chance to review the issue in order to give your opinion, that would help taking the best decision.
o
Probably it is easy to fix. Although you should count I am maintaining mostly urgent cases now. https://github.com/mockk/mockk/issues/356
a
Ok @oleksiyp , I didn't know. That why you are not responding as fast as usually ;). Please go to the issue and just give your input, I think both fixes would work, we just need to figure out what is the good solution. As you diverged from mockito and other, we need to know if this is for a good reason, or just for no reason.
From the fix, it should be almost no effort if this is just targeting the field, but I have no clue the derived impact for mockk, and even if it exists !