Skip to content

Commit

Permalink
Merge branch '3.0.x'
Browse files Browse the repository at this point in the history
Closes gh-35381
  • Loading branch information
mhalbritter committed May 10, 2023
2 parents 0ebb32e + 53d2a9f commit 9f78705
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spring-boot-project/spring-boot-autoconfigure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies {
exclude group: "commons-logging", module: "commons-logging"
}
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.tomcat.embed:tomcat-embed-core")
optional("org.apache.tomcat.embed:tomcat-embed-el")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
import org.junit.jupiter.api.Test;

import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
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.JettyResourceFactory;
import org.springframework.test.util.ReflectionTestUtils;
Expand All @@ -38,6 +40,7 @@
*
* @author Phillip Webb
* @author Brian Clozel
* @author Moritz Halbritter
*/
class ClientHttpConnectorFactoryConfigurationTests {

Expand Down Expand Up @@ -86,6 +89,14 @@ void shouldApplyHttpClientMapper() {
});
}

@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 boolean called = false;
Expand Down

0 comments on commit 9f78705

Please sign in to comment.