Sam Brannen opened SPR-14255 and commented
Status Quo
18755 introduced support for declaring test annotations on test interfaces for all class-level annotations in the Spring TestContext Framework except @Sql
and @SqlGroup
.
Analysis
As of Spring Framework 4.3, there is no first-class support in the framework for finding repeatable annotations like @Sql
on interfaces with support for merged composed annotations without finding shadowed annotations on superclasses.
Deliverables
- [ ] Determine if it is feasible to implement a search algorithm for merged repeatable annotations on interfaces (i.e., something between the "get" and "find" variants in
AnnotatedElementUtils
). - [ ] If it is feasible, support
@Sql
and@SqlGroup
on test interfaces.
Affects: 4.3 GA
Issue Links: - #18755 Support test annotations on interfaces
Comment From: sbrannen
Update
Switching the SearchStrategy
to TYPE_HIERARCHY
in TestContextAnnotationUtils.getMergedRepeatableAnnotations()
allows @Sql
annotations to be discovered on interfaces, but RepeatableSqlAnnotationSqlScriptsChildTests.classLevelScripts()
then fails, which is to be expected since the annotation search then finds too much.
The following is therefore an updated version of the original Analysis.
As of Spring Framework 5.3.12, there is still no first-class support in the framework for finding repeatable annotations like
@Sql
on interfaces with support for merged composed annotations without finding shadowed annotations on superclasses.
Comment From: sbrannen
Closing this issue since the community has not expressed interest in this feature.