If I have 2 bean that implement the same interface and the one is annotated with a profile annotation for “local” and the other has no profile annotation - will the annotated bean take preference when being wired together?
d
Davio
06/13/2024, 2:30 PM
@Profile
is only used for bean activation, not for selection, if you add
@Primary
to your test annotated bean, I think it will work
t
thanksforallthefish
06/13/2024, 2:51 PM
default scenario, you get both bean injected. then it depends on other factors, like if you have bean override enabled, if they have the same name, etc