为 Spring 启动测试上下文模拟 @Component bean

问题描述

我需要为所有测试模拟 @Component bean。

我尝试在 @ComponentScan 中使用 @Primary 和 @TestConfiguration 和 excludeFilter 但它不起作用。

如何将模拟 bean 放入 ApplicationContext 而不是真正的 bean?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)