为什么我的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 的注册错误导致的,仔细的对照下代码吧

1
0

Spring Cloud微服务实战 打造企业级优惠券系统

微服务,SpringCloud,SpringBoot面试、毕设、

1203 学习 · 487 问题

查看课程