Skip to content

Allow TestContextBootstrapper to be configured globally without @BootstrapWith #34879

Open
@EarthCitizen

Description

@EarthCitizen

I find myself needing to customize the ContextCache so that I can run tests in parallel JUnit. Yes can be done with @BootstrapWith, but it is quite burdensome to have to add this so every single test class. This is fine for a handful of classes, but not feasible with over 100 test classes.

I have worked out how to create separate Postgres databases for each application context that loads with an ApplicationContextInitializer, which can be done globally with spring.factories, but as far as I can tell, the TestContextBootstrapper can only be overridden at the class level.

I cannot use @DirtiesContext because again, I would have to annotate every class, and this is causing my Hikari pool to get closed.

In summary, it would be much appropriated to be able to customize ContextCache globally for all tests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions