Is it discouraged to use @Spy and @InjectMocks on the same field?
<p>In the project I'm working on right now,
I often see the <code>@Spy</code> and <code>@InjectMocks</code> used together on a field.
I have never seen it this way in any tutorials or other resources.
I googled about this specific combination but didn't
find anything else other than this thread on GitHub:
<a href="https://github.com/mockito/mockito/issues/169" rel="noreferrer">https://github.com/mockito/mockito/issues/169</a></p>

<p>Which makes me think we are using it in a weird way.</p>

<p>Note: The reason why I think using both annotations together
makes sense sometimes is because if you only use <code>@InjectMocks</code>
Mockito tries to instantiate the class with a no-args constructor.
If you don't have a no-args contructor and add <code>@Spy</code> you can use the object without needing an empty constructor.</p>

<p>Edit: Another important use is that you can only stub methods
if you just use both annotations.</p>