Skip to content

Support @Sql annotations on test interfaces #18827

Closed as not planned
Closed as not planned

Description

@spring-projects-issues

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:

Activity

  1. added
    in: test
    type: enhancement
    on Jan 11, 2019
  2. self-assigned this
    on Jan 15, 2019
  3. changed the title [-]Support @Sql and @SqlGroup on test interfaces [SPR-14255][/-] [+]Support @Sql annotations on test interfaces [SPR-14255][/+] on Oct 22, 2020
  4. sbrannen commented on Oct 29, 2021

    @sbrannen
    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.

  5. changed the title [-]Support @Sql annotations on test interfaces [SPR-14255][/-] [+]Support `@Sql` annotations on test interfaces[/+] on Mar 20, 2024
  6. removed their assignment
    on Dec 3, 2024
  7. sbrannen commented on Mar 24, 2025

    @sbrannen
    Member

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

  8. added
    status: declined
    on Mar 24, 2025
  9. removed this from the General Backlog milestone on Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: teststatus: declinedtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions