Skip to content

Publish TestStarted and TestCompleted events in the TestContext framework [SPR-8710] #13352

Closed
@spring-projects-issues

Description

@spring-projects-issues

Stepan Koltsov opened SPR-8710 and commented

Status Quo

AFAIU currently test initialization and finalization code must be placed into a test class (not in the application context), so code cannot be easily reused between unrelated test classes.

Proposal

SpringJUnit4ClassRunner could publish a TestStartedEvent before each test method and a TestFinishedEvent after each test in the application context. Listeners to these events could be used to clean caches from the previous test run, recreate database state before a test method, etc.


Issue Links:

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulestatus: supersededAn issue that has been superseded by anothertype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions