When the test class is testing the Controller function, the Service cannot be injected. An error Reports Could not autowire. No beans of'xxx' type found.

problem:
测试类测试Controller功能时,无法注入Service

The inspection found that there was no annotation on the service implementation class. @Service
After adding it, there ***daowas no way to inject. The
final inspection was that the mapper.xmlfile was written namespaceincorrectly.

After this problem occurs, you should check whether your injection is correct and whether there are spelling errors.

Guess you like

Origin blog.csdn.net/weixin_49035356/article/details/109850775
Recommended