Add static factory methods to WebClientAdapter
Ideally one would pass WebClient directly to HttpServiceProxyFactory, but two need to remain decoupled. This commit adds static, shortcut methods to WebClientAdapter to create an HttpServiceProxyFactory, thus eliminating the step to wrap the WebClient.
This commit is contained in:
@@ -106,10 +106,9 @@ public class WebClientHttpServiceProxyTests {
|
||||
}
|
||||
|
||||
private TestHttpService initHttpService(WebClient webClient) throws Exception {
|
||||
WebClientAdapter client = new WebClientAdapter(webClient);
|
||||
HttpServiceProxyFactory proxyFactory = new HttpServiceProxyFactory(client);
|
||||
proxyFactory.afterPropertiesSet();
|
||||
return proxyFactory.createClient(TestHttpService.class);
|
||||
HttpServiceProxyFactory factory = WebClientAdapter.createHttpServiceProxyFactory(webClient);
|
||||
factory.afterPropertiesSet();
|
||||
return factory.createClient(TestHttpService.class);
|
||||
}
|
||||
|
||||
private void prepareResponse(Consumer<MockResponse> consumer) {
|
||||
|
||||
Reference in New Issue
Block a user