Rather than making some of my classes @Autowire
many small @Component
s, I wanted to create a single @Component
that would collect and just forward to the smaller @Component
s.
Coding itself isn't too difficult, but when it comes to testing, it becomes cumbersome because now I have to add it to the @ContextConfiguration(classes)
. Is there a way of doing it so I don't have to manage it individually?
Using @ComponentScan
adds the whole package which I may not want because it will trigger more @MockBean
to be created.
Aucun commentaire:
Enregistrer un commentaire