Add Builder to HttpServiceProxyFactory

HttpServiceProxyFactory now support programmatic initialization through
a builder, while bean-style initialization is deprecated.

See gh-29296
This commit is contained in:
rstoyanchev
2022-10-17 12:23:42 +01:00
parent e03abc94ff
commit 5cb3af708c
14 changed files with 413 additions and 107 deletions

View File

@@ -105,10 +105,11 @@ public class WebClientHttpServiceProxyTests {
return initHttpService(webClient);
}
private TestHttpService initHttpService(WebClient webClient) throws Exception {
HttpServiceProxyFactory factory = WebClientAdapter.createHttpServiceProxyFactory(webClient);
factory.afterPropertiesSet();
return factory.createClient(TestHttpService.class);
private TestHttpService initHttpService(WebClient webClient) {
return HttpServiceProxyFactory.builder()
.clientAdapter(WebClientAdapter.forClient(webClient))
.build()
.createClient(TestHttpService.class);
}
private void prepareResponse(Consumer<MockResponse> consumer) {