Reset mocks after test only when the test has an ApplicationContext

See gh-36782

Signed-off-by: seregamorph <serega.morph@gmail.com>
This commit is contained in:
seregamorph
2026-05-12 11:33:07 +02:00
committed by Sam Brannen
parent 0c25d817bd
commit 1d91982f83
@@ -99,7 +99,7 @@ public class MockitoResetTestExecutionListener extends AbstractTestExecutionList
@Override
public void afterTestMethod(TestContext testContext) {
if (isEnabled()) {
if (isEnabled() && testContext.hasApplicationContext()) {
resetMocks(testContext.getApplicationContext(), MockReset.AFTER);
}
}