Skip to content

Provide a way for an ApplicationContextInitializer to access the current test class in the TestContext framework #26143

Closed
@stolsvik

Description

@stolsvik

(Not entirely sure this is a lacking feature, but I have not found it yet!)

It seems like when you're within a ApplicationContextInitializer (specified by @ContextConfiguration), you have no way of knowing which test class is being configured. That would have been nice wrt. reading annotation parameters.

Maybe a ThreadLocal hack, whereby the thread class / instance in question was available while the ApplicationContextInitializers was run, and could be accessed via a static method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: testIssues in the test modulestatus: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions