intellij incorrectly saying no beans of type found for autowired repository

前端 未结 30 2947
北恋
北恋 2020-11-30 18:33

I have created a simple unit test but IntelliJ is incorrectly highlighting it red. marking it as an error

No beans?

30条回答
  •  长情又很酷
    2020-11-30 19:07

    If you don't want to make any change to you code just to make your IDE happy. I have solved it by adding all components to the Spring facet.

    1. Create a group with name "Service, Processors and Routers" or any name you like;
    2. Remove and recreate "Spring Application Context" use the group you created previously as a parent.

提交回复
热议问题