Fix resetting of spied FactoryBean output

Fixes gh-31204
This commit is contained in:
Andy Wilkinson
2024-11-06 13:27:09 +00:00
parent e089b90a5b
commit 4900ca1ffc
2 changed files with 34 additions and 1 deletions

View File

@@ -330,6 +330,7 @@ public class MockitoPostProcessor implements InstantiationAwareBeanPostProcessor
SpyDefinition definition = this.spies.get(beanName);
if (definition != null) {
bean = definition.createSpy(beanName, bean);
this.mockitoBeans.add(bean);
}
return bean;
}