Skip to content

Introduce BEFORE_METHOD and BEFORE_CLASS modes for @DirtiesContext [SPR-12429] #17035

@spring-projects-issues

Description

@spring-projects-issues

Torsten Krah opened SPR-12429 and commented

Status Quo

@DirtiesContext currently only supports closing a test ApplicationContext after an entire test class or after a test method.

Proposal

It would be useful to have before class and before method modes, too.

Currently this is achievable with a custom TestExecutionListener which marks the context as dirty at the requested phase (before class or before method), but this could be easily achieved via new modes within the @DirtiesContext annotation.


Affects: 3.0 GA

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

Issue Links:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions