As can be seen in the tests introduced in commit 4a0edc5, the static factory methods in MockReset (such as MockReset.before() and MockReset.after()) can currently only be applied to beans within the ApplicationContext if the test class declares at least one field annotated with either @MockitoBean or @MockitoSpyBean.
However, as stated in the Javadoc, it should be possible to apply MockReset:
directly to any mock in the ApplicationContext using the static methods in this class.
We therefore need to rework the "enabled" logic in MockitoResetTestExecutionListener to support that documented use case.
As can be seen in the tests introduced in commit 4a0edc5, the static factory methods in
MockReset(such asMockReset.before()andMockReset.after()) can currently only be applied to beans within theApplicationContextif the test class declares at least one field annotated with either@MockitoBeanor@MockitoSpyBean.However, as stated in the Javadoc, it should be possible to apply
MockReset:We therefore need to rework the "enabled" logic in
MockitoResetTestExecutionListenerto support that documented use case.