Skip to content

FactoryBean.getObject for non-singleton executed when resetting mocks #35324

@csmager

Description

@csmager

This bug #33830 was fixed with this commit 9940fcf and released in 2.7.9.

I have a FactoryBean I use to create a context object for my tests. The context is quite expensive to create and I want an instance-per-test. FactoryBean.isSingleton() returns false. Up until 2.7.8, this all worked as expected.

Following the change above, getObject is now called for every test run that ends up resetting mocks.

My understanding of the above issue was that it needs to reset mocks that are singletons. While the FactoryBean itself is a singleton, the objects produced by it are not. I'm not sure the result of this change would be what is expected.

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions