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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user