Remove TestRestTemplate constructors taking template args

As discussed in gh-11872, `TestRestTemplate` constructor variants taking
a `RestTemplate` argument are confusing since the main goal of that
class is to mutate `RestTemplate`.

This commit removes all those constructor variants and replaces them
with `RestTemplateBuilder` arguments when possible.

Closes gh-11872
This commit is contained in:
Brian Clozel
2018-02-12 16:44:32 +01:00
parent eec3eed5f5
commit 2be0c46562
5 changed files with 27 additions and 18 deletions

View File

@@ -46,7 +46,7 @@ public class SpockTestRestTemplateExample {
Environment environment) {
RestTemplateBuilder builder = builderProvider.getIfAvailable();
TestRestTemplate template = builder == null ? new TestRestTemplate()
: new TestRestTemplate(builder.build());
: new TestRestTemplate(builder);
template.setUriTemplateHandler(new LocalHostUriTemplateHandler(environment));
return template;
}