问题现象:
启动测试类(含通过Feign远程调用的组件),报错: No qualifying bean of type ‘org.springframework.cloud.openfeign.FeignContext’ available
问题解决:
在测试类上加上如下代码:
import org.springframework.cloud.netflix.ribbon.RibbonAutoConfiguration;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.ribbon.FeignRibbonClientAutoConfiguration;
@ImportAutoConfiguration({RibbonAutoConfiguration.class, FeignRibbonClientAutoConfiguration.class, FeignAutoConfiguration.class})