You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #33925, I noticed that the search algorithm for @BeanOverride-annotated fields registers bean override handlers with "bottom up" semantics; whereas, handlers should be registered with "top down" semantics while traversing a test class hierarchy.
In other words, a bean override in a superclass currently takes precedence over a bean override in a subclass, which is incorrect.
Example
@ExtendWith(SpringExtension.class)
classBaseTests {
@TestBean("enigma")
Stringenigma;
staticStringenigma() {
return"enigma in superclass";
}
@Testvoidtest() {
assertThat(enigma).isEqualTo("enigma in superclass");
}
}
Overview
While working on #33925, I noticed that the search algorithm for
@BeanOverride
-annotated fields registers bean override handlers with "bottom up" semantics; whereas, handlers should be registered with "top down" semantics while traversing a test class hierarchy.In other words, a bean override in a superclass currently takes precedence over a bean override in a subclass, which is incorrect.
Example
BaseTests
passes as expected; however,ExtendedTests
fails with the following error.The text was updated successfully, but these errors were encountered: