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).
Comment From: scottfrederick
In https://github.com/spring-projects/spring-boot/pull/47980/commits/7aa96d055ca3474704d7901b2efbfae4a693c891 I've added another architecture rule test that builds on what was done in https://github.com/spring-projects/spring-boot/pull/47429/commits/7231be29186c7ccb7dd532e51d01856feac90cb0 to allow the annotation class name used in a rule to be overridden in a test. This commit generalizes things a bit so it should be easier to add more annotation class name overrides.
I'm happy to retrofit the refactoring changes from the 3.5.x branch back to 3.4.x and add more tests there. Or this issue could be moved to 3.5.x and I can add more tests on that release branch.