Skip to content

Make it easier to apply customisations to the SpringApplication created by @SpringBootTest #22405

Closed
@wilkinsona

Description

@wilkinsona

When creating a SpringApplication in their application's main method, users can apply customizations to meet their needs. When these same customisations are also needed in their application's tests, reusing the same customizations isn't particularly easy. Without sub-classing SpringBootContextLoader, you can't get hold of the SpringApplication without jumping through some hoops. It's possible via a listener and the ApplicationEnvironmentPreparedEvent but that feels harder than it should.

Related: #22379, #15077

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions