spring-projects / spring-projects/spring-framework

Extend default script detection in `@Sql` to account for execution phase [SPR-13322]

Open
#17,907 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: test type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

Robert Thaler opened SPR-13322 and commented

Status Quo

We often need to prepare data before a specific test and clean up this data after the test. Therefore we use two distinct scripts assigned to the test's ExecutionPhase.

Proposal

Appending a suffix such as _before or _after to the default script name would allow one to use default detection with different scripts for preparation and cleanup.

Deliverables
  1. Default script detection should take the ExecutionPhase into account.

Affects: 4.1 GA

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the @Sql default script detection and its handling of ExecutionPhase. Review the related Spring testing code and existing tests, then verify that preparation and cleanup phases can resolve distinct default scripts using the proposed suffixes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.