$ mvn test -Dtest=HttpClientChoiceComparisonTest [INFO] Running com.ankurm.resttestclient.HttpClientChoiceComparisonTest [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.876 s -- in com.ankurm.resttestclient.HttpClientChoiceComparisonTest [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 # Same real server, same request, two different ClientHttpRequestFactory implementations: # theJdkHttpClientDecodesGzipAndHidesTheHeader asserts Content-Encoding is absent through # JdkClientHttpRequestFactory (java.net.http.HttpClient) -- the one Boot's # ClientHttpRequestFactoryBuilder.detect() actually picks on this classpath. # theOldHttpUrlConnectionFactoryShowsTheRealHeader asserts Content-Encoding equals "gzip" through # SimpleClientHttpRequestFactory (java.net.HttpURLConnection) instead. Both pass: the two clients # genuinely disagree about what they show you for the identical bytes on the wire.