Add rest-test-client module: RestTestClient across all four binding modes, TestRestTemplate relocation, gzip-hiding HTTP client surprise (post #44)

This commit is contained in:
Claude
2026-10-08 09:40:13 +00:00
parent 5851521420
commit 5e4d481c02
22 changed files with 795 additions and 5 deletions
@@ -0,0 +1,12 @@
$ 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.