spring-projects / spring-projects/spring-framework
Execute all test methods in a class within the same transaction [SPR-5520]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
Eric Jain opened SPR-5520 and commented
Being able to configure that all test methods in a class should be run in the same transaction would be useful for people using TestNG (which supports test method dependencies) to write functional tests.
This feature could also be useful in JUnit Jupiter when using @TestInstance(PER_CLASS) or the planned support for scenario tests.
Affects: 2.5.6
Issue Links:
- #21093 TestEntityManager can't be configured in
@BeforeAllmethod in test class with@TestInstance(PER_CLASS) in JUnit Jupiter ("is duplicated by") - #16024 Support
@Transactionalon TestNG@BeforeClassmethods in the TestContext framework
1 votes, 1 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by locating the Spring TestContext transaction support used with TestNG and JUnit Jupiter, then review the related @BeforeAll and @TestInstance(PER_CLASS) cases. Done means all test methods in a class can be configured to run within the same transaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100