Skip to content

Support @Sql annotations on test interfaces #18827

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

Closed
2 tasks
spring-projects-issues opened this issue May 5, 2016 · 2 comments
Closed
2 tasks

Support @Sql annotations on test interfaces #18827

spring-projects-issues opened this issue May 5, 2016 · 2 comments
Labels
in: test Issues in the test module status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

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:

@spring-projects-issues spring-projects-issues added in: test Issues in the test module type: enhancement A general 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

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.

@sbrannen sbrannen changed the title Support @Sql annotations on test interfaces [SPR-14255] Support @Sql annotations on test interfaces Mar 20, 2024
@sbrannen sbrannen removed their assignment Dec 3, 2024
@sbrannen
Copy link
Member

Closing this issue since the community has not expressed interest in this feature.

@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2025
@sbrannen sbrannen added the status: declined A suggestion or change that we don't feel we should currently apply label Mar 24, 2025
@jhoeller jhoeller removed this from the General Backlog milestone Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants