commit
9f787050b4
|
@ -59,7 +59,7 @@ dependencies {
|
||||||
exclude group: "commons-logging", module: "commons-logging"
|
exclude group: "commons-logging", module: "commons-logging"
|
||||||
}
|
}
|
||||||
optional("org.apache.httpcomponents.client5:httpclient5")
|
optional("org.apache.httpcomponents.client5:httpclient5")
|
||||||
optional("org.apache.httpcomponents.core5:httpcore5-reactive");
|
optional("org.apache.httpcomponents.core5:httpcore5-reactive")
|
||||||
optional("org.apache.kafka:kafka-streams")
|
optional("org.apache.kafka:kafka-streams")
|
||||||
optional("org.apache.tomcat.embed:tomcat-embed-core")
|
optional("org.apache.tomcat.embed:tomcat-embed-core")
|
||||||
optional("org.apache.tomcat.embed:tomcat-embed-el")
|
optional("org.apache.tomcat.embed:tomcat-embed-el")
|
||||||
|
|
|
@ -24,8 +24,10 @@ import org.eclipse.jetty.util.thread.Scheduler;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||||
|
import org.springframework.boot.test.context.FilteredClassLoader;
|
||||||
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
|
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.http.client.reactive.HttpComponentsClientHttpConnector;
|
||||||
import org.springframework.http.client.reactive.JettyClientHttpConnector;
|
import org.springframework.http.client.reactive.JettyClientHttpConnector;
|
||||||
import org.springframework.http.client.reactive.JettyResourceFactory;
|
import org.springframework.http.client.reactive.JettyResourceFactory;
|
||||||
import org.springframework.test.util.ReflectionTestUtils;
|
import org.springframework.test.util.ReflectionTestUtils;
|
||||||
|
@ -38,6 +40,7 @@ import static org.mockito.Mockito.mock;
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
|
* @author Moritz Halbritter
|
||||||
*/
|
*/
|
||||||
class ClientHttpConnectorFactoryConfigurationTests {
|
class ClientHttpConnectorFactoryConfigurationTests {
|
||||||
|
|
||||||
|
@ -86,6 +89,14 @@ class ClientHttpConnectorFactoryConfigurationTests {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldNotConfigureReactiveHttpClient5WhenHttpCore5ReactiveJarIsMissing() {
|
||||||
|
new ReactiveWebApplicationContextRunner()
|
||||||
|
.withClassLoader(new FilteredClassLoader("org.apache.hc.core5.reactive"))
|
||||||
|
.withConfiguration(AutoConfigurations.of(ClientHttpConnectorFactoryConfiguration.HttpClient5.class))
|
||||||
|
.run((context) -> assertThat(context).doesNotHaveBean(HttpComponentsClientHttpConnector.class));
|
||||||
|
}
|
||||||
|
|
||||||
static class CustomHttpClientMapper {
|
static class CustomHttpClientMapper {
|
||||||
|
|
||||||
static boolean called = false;
|
static boolean called = false;
|
||||||
|
|
Loading…
Reference in New Issue