Skip to content

@DirtiesContext does not destroy all cached singleton beans [SPR-8857] #13499

Closed
@spring-projects-issues

Description

@spring-projects-issues

Saurabh Chandra opened SPR-8857 and commented

Data from one test having data-source as H2 (in-memory database) seems to live on for the next test class. This persists even after using @DirtiesContext at class or method level.

Currently we have to clear any data from H2 before every a test.

@DirtiesContext should clear all that is bound to the context (including data-source).

If it might help we are using JUnit 4.8.1.


Issue Links:

5 votes, 9 watchers

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulestatus: bulk-closedAn outdated, unresolved issue that's closed in bulk as part of a cleaning process

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions