spring-projects / spring-projects/spring-framework

Support 'throw-away' context for a test class [SPR-13722]

Open
#18,295 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

Grzegorz Poznachowski opened SPR-13722 and commented

It would be nice to have an option for marking a single test class to get a fresh context and not use a cached context at all (i.e. using BeanFactoryPostProcessor for that test class).


Affects: 4.2.3

Reference URL: http://stackoverflow.com/questions/26931236/is-it-possble-to-reset-spring-tests-context-cache-before-a-test-suite-runs-not

Issue Links:

  • #16647 Support @ContextConfiguration at method level
  • #9309 Load dedicated child ApplicationContext for test instance in the TestContext framework
  • #12710 Limit size of context cache in the TestContext framework

1 votes, 3 watchers

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 reviewing the Spring TestContext framework and the related issues #16647, #9309, and #12710 to understand the existing context lifecycle and cache behavior. The work is done when a single test class can request a fresh, uncached context, with the behavior covered by the project's tests.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.