Fix ClientHttpConnectorConfigurationTests.shouldApplyHttpClientMapper()

See gh-21390
This commit is contained in:
Johnny Lim 2020-05-11 22:50:39 +09:00 committed by Stephane Nicoll
parent deb2322457
commit 6022d4cac7
1 changed files with 8 additions and 4 deletions

View File

@ -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 {
@Bean @Bean
ReactorNettyHttpClientMapper clientMapper() { ReactorNettyHttpClientMapper clientMapper() {
called = true; return (client) -> {
return (client) -> client.baseUrl("/test"); called = true;
return client.baseUrl("/test");
};
} }
} }