Junit单元测试错误信息:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type 'com.li.service.BookService' available: expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=BookServiceImp)}
使用Qualifier注解报红:
经过排查发现,BookServiceImp 类 忘记写了 实现BookService接口了,接口中方法是手动敲的,没有自动生成。