Hi Szczepan,
After some thought, I don't think you should include dummy in mockito
either. I think the idea might be sound, but it's unproven. Until it's
used often and successfully it probably doesn't belong.
As far as use cases go, I don't have any good concrete examples. I was
striving to come up with a concrete implementation for each of the
ideas from the post I originally linked to. However, I currently have
zero dummies in my tests. I'm not sure if that's because I don't have
the ability to easily create then or if it's because they are
unnecessary.
I do have zeroInteraction assertions, but as you said, those are cases
where that's the primary focus of the test and the assertion is
perfectly suited for the task.
I am working with very low-latency systems these days, so conceptually
each method call does matter. Therefore, there is a possibility of
middle ground where I don't want to always assert that no interactions
took place, but I do want to be alerted if additional unexpected
interactions take place. Sort of like a warning that unexpected
interactions took place. . However, I haven't really focused on this
approach, so I don't have good practical experience.
Once I get the ability to easily create dummies I'll add a few to my
code base and let you know what the results are.
Cheers, Jay
Sent from my iPhone