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
{{ message }}
Repository navigation
Support @Sql annotations on test interfaces #18827
#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.
changed the title [-]Support @Sql and @SqlGroup on test interfaces [SPR-14255][/-][+]Support @Sql annotations on test interfaces [SPR-14255][/+]on Oct 22, 2020
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.
Activity
[-]Support @Sql and @SqlGroup on test interfaces [SPR-14255][/-][+]Support @Sql annotations on test interfaces [SPR-14255][/+]sbrannen commentedon Oct 29, 2021
Update
Switching the
SearchStrategytoTYPE_HIERARCHYinTestContextAnnotationUtils.getMergedRepeatableAnnotations()allows@Sqlannotations to be discovered on interfaces, butRepeatableSqlAnnotationSqlScriptsChildTests.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.
[-]Support @Sql annotations on test interfaces [SPR-14255][/-][+]Support `@Sql` annotations on test interfaces[/+]sbrannen commentedon Mar 24, 2025
Closing this issue since the community has not expressed interest in this feature.