package com.heima.wemedia.test.service; import com.heima.wemedia.WemediaApplication; import com.heima.wemedia.service.WmNewsAutoScanService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @SpringBootTest(classes = WemediaApplication.class) @RunWith(SpringRunner.class) public class WmNewsArticleScanServiceTest { @Autowired private WmNewsAutoScanService wmNewsAutoScanService; @Test public void autoScanTest(){ wmNewsAutoScanService.autoScanWmNews(6232); } }
当程序运行响应较慢时,由于Feign客户端默认连接超时时间是10s,默认读取超时时间是60s,程序过慢会自动断开。因此要根据实际情况设置Feign客户端的connectTimeout和readTimeout。
标签:heima,org,文章,单元测试,springframework,import,test,审核,class From: https://www.cnblogs.com/fxzm/p/17517320.html