You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in my Spring Boot + Kotlin codebase I have a @RestController asking for various dependencies via constructor injection. Most of these dependencies in turn ask for other dependencies themselves. So far nothing unusual, I guess.
Now I'd like to write a few tests where I use some of the dependencies but about others I don't care so much.
But I still need to make them available as Beans.
So, I've been @SpykBeaning each individual one of those I don't care about:
Hi,
in my Spring Boot + Kotlin codebase I have a
@RestController
asking for various dependencies via constructor injection. Most of these dependencies in turn ask for other dependencies themselves. So far nothing unusual, I guess.Now I'd like to write a few tests where I use some of the dependencies but about others I don't care so much.
But I still need to make them available as Beans.
So, I've been
@SpykBean
ing each individual one of those I don't care about:But I thought maybe there is an easier/shorter way, so I found
@SpykBeans
(plural):The former works, the latter doesn't, Spring can't find the beans. Am I using this wrong?
🙏
The text was updated successfully, but these errors were encountered: