intellij incorrectly saying no beans of type found for autowired repository

前端 未结 30 2961
北恋
北恋 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

    I am using spring-boot 2.0, and intellij 2018.1.1 ultimate edition and I faced the same issue.

    I solved by placing @EnableAutoConfiguration in the main application class

    @SpringBootApplication
    @EnableAutoConfiguration
    class App{
    /**/
    }
    

提交回复
热议问题