Skip to content
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

Introduce createContext() factory method in AbstractGenericContextLoader #25600

Closed
wants to merge 1 commit into from

Conversation

maciejmiklas
Copy link
Contributor

@maciejmiklas maciejmiklas commented Aug 17, 2020

We have customized DefaultListableBeanFactory and are using it already in AnnotationConfigWebApplicationContext for production.

Now we would like to customize the DefaultListableBeanFactory for integration tests as well, but in order to archive that we need a new factory method in AbstractGenericContextLoader.

@pivotal-issuemaster
Copy link

@maciejmiklas Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@maciejmiklas Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 17, 2020
@sbrannen sbrannen changed the title createContext() for AbstractGenericContextLoader Introduce createContext() factory method in AbstractGenericContextLoader Aug 17, 2020
@sbrannen sbrannen added in: test Issues in the test module type: enhancement A general enhancement labels Aug 17, 2020
@sbrannen
Copy link
Member

Now we would like to customize the Bean Factory for Unit Tests.

Why does org.springframework.test.context.support.AbstractGenericContextLoader.customizeBeanFactory(DefaultListableBeanFactory) not meet your needs?

@sbrannen sbrannen added the status: waiting-for-feedback We need additional information before we can continue label Aug 17, 2020
@sbrannen sbrannen self-assigned this Aug 17, 2020
@maciejmiklas
Copy link
Contributor Author

maciejmiklas commented Aug 17, 2020 via email

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Aug 17, 2020
@sbrannen sbrannen removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Aug 17, 2020
@sbrannen
Copy link
Member

because I would like to replace (use my custom implementation) of DefaultListableBeanFactory.

Understood.

Thanks for the prompt feedback.

I think it should be relatively safe to include such a change in 5.2.x, since it's unlikely that somebody has an existing createContext() method in a subclass of AbstractGenericContextLoader.

@sbrannen sbrannen added this to the 5.2.9 milestone Aug 17, 2020
@maciejmiklas
Copy link
Contributor Author

Thank you!

sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 17, 2020
@sbrannen sbrannen closed this in a83529c Aug 17, 2020
@sbrannen
Copy link
Member

sbrannen commented Aug 17, 2020

This has been merged into 5.2.x and master in a83529c and revised in d939016.

Thanks

sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 21, 2022
…Loader

Prior to this commit it was possible to configure the
DefaultListableBeanFactory used by the GenericWebApplicationContext
created by AbstractWebGenericContextLoader, but it was not possible to
completely replace the bean factory.

This commit introduces a new createContext() factory method in
AbstractWebGenericContextLoader which indirectly allows subclasses to
supply a custom DefaultListableBeanFactory implementation to the
GenericWebApplicationContext.

See spring-projectsgh-25600
Closes spring-projectsgh-28983
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 21, 2022
…Loader

Prior to this commit it was possible to configure the
DefaultListableBeanFactory used by the GenericWebApplicationContext
created by AbstractWebGenericContextLoader, but it was not possible to
completely replace the bean factory.

This commit introduces a new createContext() factory method in
AbstractWebGenericContextLoader which indirectly allows subclasses to
supply a custom DefaultListableBeanFactory implementation to the
GenericWebApplicationContext.

See spring-projectsgh-25600
Closes spring-projectsgh-28983
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants