This commit reviews how bean override support can influence the key of an application context cached by the TCF. OverrideMetadata and its subclasses now implement a proper equals/hashCode pair that is tested in various scenarios. Due to how the TCF operates, OverrideMetadata has to be computed in two locations: 1. In a ContextCustomizerFactory, using the metadata in the enclosing class if any. This determines whether a customizer is needed in the first place. The computed set of unique metadata identifies the customizer and participates in the application context cache's key. 2. In the TestExecutionListener so that it knows the override points it has to process. Parsing of the metadata based on a test class has been greatly simplified and moved to OverrideMetadata proper as we don't need several flavors. 1 and 2 are using the same algorithm with the former wrapping that in a Set to compute a proper key. BeanOverrideContextCustomizerEqualityTests provides a framework for testing edge cases as we only care about whether the created ContextCustomizer behaves correctly against the identity of another. Closes gh-32884 |
||
|---|---|---|
| .. | ||
| src | ||
| .springBeans | ||
| spring-test.gradle | ||