Skip to content

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

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

Open
spring-projects-issues opened this issue Nov 25, 2015 · 6 comments
Open
Labels
in: test Issues in the test module type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 25, 2015

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:

1 votes, 3 watchers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 25, 2015

Sam Brannen commented

This issue is closely related to #16647.

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Dziesio,

What do you mean by the following?

i.e. using BeanFactoryPostProcessor for that test class

@spring-projects-issues
Copy link
Collaborator Author

Grzegorz Poznachowski commented

In some of my tests I'm using BeanFactoryPostProcessor to modify bean declarations. For such cases I would find throw-away context useful.

@denniseffing
Copy link

We have a similar (small) issue where this would have been helpful as well.

@ian4hu
Copy link

ian4hu commented Jun 4, 2021

Did some one tried the @DirtiesContext annotation?

@sbrannen
Copy link
Member

sbrannen commented Jan 4, 2024

Please note that I provided a DirtyContextBeforeAndAfterClassTestExecutionListener workaround on Stack Overflow.

@sbrannen sbrannen removed their assignment Mar 8, 2024
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 type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants