Affects: 6.0.13
Using TestRestTemplate with unspecified connectTimeout and readTimeout make it fall back to underlying OkHttp3Client defaults which are 10000ms each.
Using explicit timeout values in TestRestTemplate overrides OkHttp3Client successfully.
It is (well, not a good) standard that library timeouts set to null
, 0
, or -1
map to infinity, but right now, timeout settings are completely hidden from the library users, who widely believe that [Test]RestClient have infinite timeouts by default.
If it is so by design, it should probably be pointed out that spring-web users should always fall back to the default settings of the client implementation they are currently using (although they probably don't know which one is it).
from: org.springframework.http.client.OkHttp3ClientHttpRequest
from: org.springframework.http.client.OkHttp3ClientHttpRequest
Comment From: snicoll
@KrzysztofOwczarekDiscovery thanks for the report but OkHttp3 support is deprecated and will be removed so we don't intend to make further change to it.