Skip to content

Introduce support for test-scoped beans in the TestContext framework [SPR-14034] #18606

Open
@spring-projects-issues

Description

@spring-projects-issues

Caleb Cushing opened SPR-14034 and commented

I'd like to be able to register a bean as @Scope("test") (or @TestScope), so that after an integration test is executed this bean is cleaned up. I don't want to use @DirtiesContext because this is the only bean I want to throw away.

For the actual use case I've built a sort of "Login Manager" for selenium that knows which user is currently logged in and which roles have test users created for them. This can't be shared between tests because we only allow a single session for a user.

I looked to see if this exists in the reference documentation and couldn't find anything.

Related Issues


No further details from SPR-14034

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions