mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
6bdf0bcc4a
This commit introduces an ApplicationContextFailureProcessor SPI in the Spring TestContext Framework that allows third parties to process failures that occur while a SmartContextLoader attempts to load an ApplicationContext. SmartContextLoader implementations must introduce a try-catch block around the loading code and throw a ContextLoadException that wraps the failed ApplicationContext and the cause of the failure. Extensions of AbstractTestContextBootstrapper can configure an ApplicationContextFailureProcessor by overriding the new protected getApplicationContextFailureProcessor() method. DefaultCacheAwareContextLoaderDelegate unwraps any ContextLoadException and delegates to the configured ApplicationContextFailureProcessor for processing. Closes gh-28826