Commit 6022d4ca authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Fix ClientHttpConnectorConfigurationTests.shouldApplyHttpClientMapper()

See gh-21390
parent deb23224
...@@ -76,8 +76,10 @@ class ClientHttpConnectorConfigurationTests { ...@@ -76,8 +76,10 @@ class ClientHttpConnectorConfigurationTests {
void shouldApplyHttpClientMapper() { void shouldApplyHttpClientMapper() {
new ReactiveWebApplicationContextRunner() new ReactiveWebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ClientHttpConnectorConfiguration.ReactorNetty.class)) .withConfiguration(AutoConfigurations.of(ClientHttpConnectorConfiguration.ReactorNetty.class))
.withUserConfiguration(CustomHttpClientMapper.class) .withUserConfiguration(CustomHttpClientMapper.class).run((context) -> {
.run((context) -> assertThat(CustomHttpClientMapper.called).isTrue()); context.getBean("reactorClientHttpConnector");
assertThat(CustomHttpClientMapper.called).isTrue();
});
} }
static class CustomHttpClientMapper { static class CustomHttpClientMapper {
...@@ -86,8 +88,10 @@ class ClientHttpConnectorConfigurationTests { ...@@ -86,8 +88,10 @@ class ClientHttpConnectorConfigurationTests {
@Bean @Bean
ReactorNettyHttpClientMapper clientMapper() { ReactorNettyHttpClientMapper clientMapper() {
called = true; return (client) -> {
return (client) -> client.baseUrl("/test"); called = true;
return client.baseUrl("/test");
};
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment