springboot使用RestTemplate单元测试时,提示ResourceAccess I/O error on POST request for "http(转)


springboot使用TestRestTemplate单元测试时,提示ResourceAccess I/O error on POST request for "http

发现如果后台的http状态码返回401则会出现这种情况(其他4XX等可能也会)

解决方案,pom.xml加入

 <dependency>
     <groupId>org.apache.httpcomponents</groupId>
     <artifactId>httpclient</artifactId>
     <scope>test</scope>
 </dependency>


转自 https://www.kanzhun.com/jiaocheng/296424.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM