Skip to content

Wrong semantic for immutable @ConfigurationProperties contributed via @Import #17831

@mpalourdio

Description

@mpalourdio

Hello,

As of SB 2.2.0.M5, the changelog states that @ConfigurationProperties-annotated types are no longer scanned in slice tests unless imported explicitly. This restores the behaviour that slice tests should only scan what is described in the documentation.

When an immutable @ConfigurationProperties is imported in a test slice, and the constructor parameters are not beans (ex : strings), the test fail.

As it's not that easy to describe, I have done a repository that reproduces the issue : https://github.com/mpalourdio/demorepro . Please run the single test to see it fail.

In order to make it work with SB 2.0.0.M4, remove the @Import in the test class, and change the SB version in pom.xml to target SB 2.0.0.M4. The test will succeed.

Thanks by advance, and let me know if you need more information.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions