Support declarative ContextCustomizerFactory registration in the TCF

Prior to this commit, it was only possible to register a
ContextCustomizerFactory in the TestContext framework (TCF) via the
SpringFactoriesLoader mechanism.

This commit introduces support for declarative registration of a
ContextCustomizerFactory local to a test class via a new
@ContextCustomizerFactories annotation.

Closes gh-26148
This commit is contained in:
Sam Brannen
2023-06-30 13:29:12 +02:00
parent 99a50e7cea
commit a220c545fc
27 changed files with 1085 additions and 70 deletions

View File

@@ -4,7 +4,8 @@
org.springframework.test.context.TestExecutionListener = org.example.FooListener
org.springframework.test.context.ContextCustomizerFactory =\
org.springframework.test.context.aot.samples.basic.ImportsContextCustomizerFactory
org.springframework.test.context.aot.samples.basic.ImportsContextCustomizerFactory,\
org.springframework.test.context.customizers.GlobalFruitContextCustomizerFactory
org.springframework.test.context.ApplicationContextFailureProcessor =\
org.springframework.test.context.failures.TrackingApplicationContextFailureProcessor