Just for clarification - is @EnableConfigurationProperties
allowed on test class ConfigTest
or does following test code work purely by chance. Thanks in advance
@EnableConfigurationProperties(SampleProperties.class)
@SpringJUnitConfig
class ConfigTest {
@Autowired
private SampleProperties sampleProperties;
@Test
void autowiring() {
assertNotNull(sampleProperties);
}
@ConfigurationProperties("sample")
record SampleProperties(String name, String description) {}
}
Spring Boot 3.4.2
Comment From: snicoll
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.