Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
csmager opened this issue May 5, 2023 · 0 comments
Closed

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

csmager opened this issue May 5, 2023 · 0 comments
Assignees
Labels
type: regression A regression from a previous release
Milestone

Comments

@csmager
Copy link

csmager commented May 5, 2023

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 5, 2023
@wilkinsona wilkinsona added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels May 5, 2023
@wilkinsona wilkinsona added this to the 2.7.x milestone May 5, 2023
@wilkinsona wilkinsona self-assigned this May 5, 2023
@wilkinsona wilkinsona modified the milestones: 2.7.x, 2.7.12 May 5, 2023
@philwebb philwebb changed the title FactoryBean.getObject for non-singleton executed when resetting mocks FactoryBean.getObject for non-singleton executed when resetting mocks Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants