为什么我的ExecuteManager无法成功注入?
来源:10-16 满减优惠券结算测试

weixin_慕勒6332898
2022-11-14
如上面所示,当我启动测试类方法的时候,就会报bean容器中无法找到ExecuteManager这个bean
Error creating bean with name ‘com.imooc.coupon.executor.ExecuteManagerTest’: Unsatisfied dependency expressed through field ‘manager’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.imooc.coupon.executor.ExecuteManager’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
写回答
1回答
-
张勤一
2022-11-14
可以看到报错,肯定是某个 bean 的注册错误导致的,仔细的对照下代码吧
10
相似问题