I am trying to mock the responses using hoverfly, but it not working with webclient. Same setup works if i switch to RestTemplate for service calls and i am using following webclient configs.
@Bean
public WebClient webClient() {
HttpClient httpClient = HttpClient.create();
if (proxyEnabled) {
LOGGER.info(s("Using proxy: {}:{}"), proxyHost, proxyPort);
httpClient = httpClient
.proxy(proxy -> proxy.type(ProxyProvider.Proxy.HTTP).host(proxyHost).port(proxyPort))
.wiretap(true);
}
return WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(httpClient))
.build();
}