spring-boot/spring-boot-project
Brian Clozel 03a6f97e76 TestRestTemplate should not override request factory
Previously `TestRestTemplate` would override the configured
`ClientHttpRequestFactory` if the Apache HTTP client library was on
classpath.

This commit fixes two issues:

1. The existing `ClientHttpRequestFactory` is overridden *only* if it is
using the Apache HTTP client variant, in order to wrap it with the
`TestRestTemplate` custom support

2. Calling `withBasicAuth` will no longer directly use the request
factory returned by the internal `RestTemplate`; if client interceptors
are configured, the request factory is wrapped with an
`InterceptingClientHttpRequestFactory`. If we don't unwrap it,
interceptors are copied/applied twice in the newly created
`TestRestTemplate` instance. For that, we need to use reflection as the
underlying request factory is not accessible directly.

Closes gh-8697
2018-02-16 12:29:47 +01:00
..
spring-boot Merge branch '1.5.x' 2018-02-14 17:22:52 +00:00
spring-boot-actuator Polish 2018-02-13 14:41:12 -08:00
spring-boot-actuator-autoconfigure Rename ReactiveWebServerAutoConfiguration 2018-02-16 10:02:35 +00:00
spring-boot-autoconfigure Rename ReactiveWebServerAutoConfiguration 2018-02-16 10:02:35 +00:00
spring-boot-cli Polish static final usage for constants 2018-02-13 14:53:26 -08:00
spring-boot-dependencies Try building against Spring Security 5.0.2 snapshots again 2018-02-16 10:03:57 +00:00
spring-boot-devtools Polish modifier order 2018-02-13 09:49:59 +01:00
spring-boot-docs Merge pull request #12073 from Sébastien Deleuze 2018-02-15 15:56:46 +00:00
spring-boot-parent Merge branch '1.5.x' 2018-02-15 16:23:17 +00:00
spring-boot-properties-migrator Restore "Reason: " prefix 2018-01-30 15:14:49 +01:00
spring-boot-starters Use Jersey BOM in dependency management 2018-02-16 08:25:20 +00:00
spring-boot-test TestRestTemplate should not override request factory 2018-02-16 12:29:47 +01:00
spring-boot-test-autoconfigure Provide package info for all packages included in javadoc 2018-02-08 16:50:37 +00:00
spring-boot-tools Merge branch '1.5.x' 2018-02-13 15:05:28 +00:00
pom.xml Rename spring-boot-deprecated-properties-support 2018-01-24 11:15:17 +01:00