mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
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:
+1
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user