I just want to add a specific edge case where certain components are preferable to be configured as @Bean's rather than @Component, @Service
One such scenario is when doing @WebMvcTest for testing authentication. Because @WebMvcTest auto configures Spring security if it is found on the classpath, but then because certain custom beans declared as @Service, will not be picked up by component scanning.
If I declare it as a @Bean in a config file, it can just be imported inside and used around