Skip to content

ApplicationContextRunner does not work correctly when AutoConfiguration class has not @Configuration #13129

@filiphr

Description

@filiphr

This is most definitely my error that I forgot to add an @Configuration to my custom auto configuration.

The problem occurs when an auto configuration class (e.g. MyCustomAutoConfiguration) has a nested configuration class with @EnableConfigurationProperties is missing a @Configuration (the root class) then the Spring Boot application works correctly. However, when using the ApplicationContextRunner the behaviour is not the same.

See this repository for a reproducing example. In the example repo if you move the @EnableConfigurationProperties then tests that were failing before will pass.

If you think that there is nothing that Boot can do about this, feel free to close it. I was just confused why it was working in one instance, but not in the other

Metadata

Metadata

Assignees

Labels

for: external-projectFor an external project and not something we can fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions