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.

Comment From: pivotal-issuemaster

@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.

Comment From: pivotal-issuemaster

@maciejmiklas Thank you for signing the Contributor License Agreement!

Comment From: sbrannen

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?

Comment From: maciejmiklas

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

The whole point of this change is to be able to replace DefaultListableBeanFactory. It's possible with AnnotationConfigWebApplicationContext but not for Unit-Tests

On 17 Aug 2020, at 14:23, Sam Brannen notifications@github.com wrote:

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?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spring-projects/spring-framework/pull/25600#issuecomment-674849833, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZMFRFHCXAKCK5XZGYIO6DSBEOMRANCNFSM4QBSR57A.

Comment From: sbrannen

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.

Comment From: maciejmiklas

Thank you!

Comment From: sbrannen

This has been merged into 5.2.x and master in a83529c844f9468223c634bac7ba22b4587e0925 and revised in d939016a091b8f0c6520a2f6f08c576f966bfa32.

Thanks