mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 14:09:25 +00:00
Allow local @BootstrapWith annotation to override a meta-annotation
This commit revises the resolveExplicitTestContextBootstrapper() algorithm in BootstrapUtils to allow a local @BootstrapWith annotation to override a meta-annotation within the same composed annotation. Closes gh-35938
This commit is contained in:
@@ -146,13 +146,7 @@ class BootstrapUtilsTests {
|
||||
*/
|
||||
@Test // gh-35938
|
||||
void resolveTestContextBootstrapperWithMetaBootstrapWithAnnotationThatOverridesMetaMetaBootstrapWithAnnotation() {
|
||||
BootstrapContext bootstrapContext = BootstrapTestUtils.buildBootstrapContext(
|
||||
MetaAndMetaMetaBootstrapWithAnnotationsClass.class, delegate);
|
||||
assertThatIllegalStateException()
|
||||
.isThrownBy(() -> resolveTestContextBootstrapper(bootstrapContext))
|
||||
.withMessageContaining("Configuration error: found multiple declarations of @BootstrapWith")
|
||||
.withMessageContaining(FooBootstrapper.class.getSimpleName())
|
||||
.withMessageContaining(BarBootstrapper.class.getSimpleName());
|
||||
assertBootstrapper(MetaAndMetaMetaBootstrapWithAnnotationsClass.class, BarBootstrapper.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user