We have some architecture checks that reference Spring Boot types such as @ConfigurationProperties
and @ConditionalOnMissingBean
. They have no tests at the moment as those types are not available for us to test against (we use string references in the checks themselves). We should try to improve this, perhaps by following a similar pattern to the configuration metadata annotation processor where the names of the annotations are configurable and overridden by TestConfigurationMetadataAnnotationProcessor
. If we follow this approach, I'd change both the class names and the package names (rather than just the package names) to avoid duplicates when opening types by name in an IDE.
Comment From: nosan
Since I was working on https://github.com/spring-projects/spring-boot/issues/47200, and that requires writing an architecture test for @ConditionalOnClass
, this issue is partially fixed in PR https://github.com/spring-projects/spring-boot/pull/47429.
The annotation name can be configured and can have a different name or package.
Comment From: snicoll
If we follow this approach, I'd change both the class names and the package names (rather than just the package names) to avoid duplicates when opening types by name in an IDE.
That's a good idea. I think we should do the same for the annotation processor (#47468).