Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support @Sql annotations on test interfaces [SPR-14255] #18827

Open
2 tasks
spring-projects-issues opened this issue May 5, 2016 · 1 comment
Open
2 tasks

Support @Sql annotations on test interfaces [SPR-14255] #18827

spring-projects-issues opened this issue May 5, 2016 · 1 comment
Assignees
Labels
in: test type: enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented May 5, 2016

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
@spring-projects-issues spring-projects-issues added in: test type: enhancement labels Jan 11, 2019
@sbrannen sbrannen self-assigned this Jan 15, 2019
@sbrannen sbrannen changed the title Support @Sql and @SqlGroup on test interfaces [SPR-14255] Support @Sql annotations on test interfaces [SPR-14255] Oct 22, 2020
@sbrannen
Copy link
Member

@sbrannen sbrannen commented Oct 29, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants