mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-04 08:19:50 +00:00
Move RestTestClientBuilderCustomizer to spring-boot-test
Relocate `RestTestClientBuilderCustomizer` to `spring-boot-test` and break the direct link to web-server by making use of `spring.factories` and the new `BaseUrlProviders` class. See gh-46356
This commit is contained in:
+1
-2
@@ -22,7 +22,6 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.boot.test.http.server.BaseUrl;
|
||||
import org.springframework.boot.test.http.server.BaseUrlProvider;
|
||||
import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory;
|
||||
import org.springframework.boot.web.server.reactive.AbstractReactiveWebServerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
/**
|
||||
@@ -65,7 +64,7 @@ class ReactiveWebServerApplicationContextBaseUrlProvider implements BaseUrlProvi
|
||||
private boolean isSslEnabled(ReactiveWebServerApplicationContext context) {
|
||||
try {
|
||||
AbstractConfigurableWebServerFactory webServerFactory = context
|
||||
.getBean(AbstractReactiveWebServerFactory.class);
|
||||
.getBean(AbstractConfigurableWebServerFactory.class);
|
||||
return webServerFactory.getSsl() != null && webServerFactory.getSsl().isEnabled();
|
||||
}
|
||||
catch (NoSuchBeanDefinitionException ex) {
|
||||
|
||||
+1
-2
@@ -22,7 +22,6 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.boot.test.http.server.BaseUrl;
|
||||
import org.springframework.boot.test.http.server.BaseUrlProvider;
|
||||
import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory;
|
||||
import org.springframework.boot.web.server.reactive.AbstractReactiveWebServerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
/**
|
||||
@@ -65,7 +64,7 @@ class ServletWebServerApplicationContextBaseUrlProvider implements BaseUrlProvid
|
||||
private boolean isSslEnabled(ServletWebServerApplicationContext context) {
|
||||
try {
|
||||
AbstractConfigurableWebServerFactory webServerFactory = context
|
||||
.getBean(AbstractReactiveWebServerFactory.class);
|
||||
.getBean(AbstractConfigurableWebServerFactory.class);
|
||||
return webServerFactory.getSsl() != null && webServerFactory.getSsl().isEnabled();
|
||||
}
|
||||
catch (NoSuchBeanDefinitionException ex) {
|
||||
|
||||
Reference in New Issue
Block a user