Rename ReactiveWebServerAutoConfiguration
Closes gh-12086
This commit is contained in:
parent
e72506c353
commit
fe4c8f95ed
|
|
@ -24,7 +24,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
|||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration;
|
||||
import org.springframework.boot.web.context.ConfigurableWebServerApplicationContext;
|
||||
import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext;
|
||||
import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory;
|
||||
|
|
@ -44,7 +44,7 @@ class ReactiveManagementContextFactory implements ManagementContextFactory {
|
|||
AnnotationConfigReactiveWebServerApplicationContext child = new AnnotationConfigReactiveWebServerApplicationContext();
|
||||
child.setParent(parent);
|
||||
Class<?>[] combinedClasses = ObjectUtils.addObjectToArray(configClasses,
|
||||
ReactiveWebServerAutoConfiguration.class);
|
||||
ReactiveWebServerFactoryAutoConfiguration.class);
|
||||
child.register(combinedClasses);
|
||||
registerReactiveWebServerFactory(parent, child);
|
||||
return child;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
|
|||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration;
|
||||
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
|
||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||
|
|
@ -95,7 +95,7 @@ public class TomcatMetricsAutoConfigurationTests {
|
|||
AnnotationConfigReactiveWebServerApplicationContext::new)
|
||||
.withConfiguration(AutoConfigurations.of(
|
||||
TomcatMetricsAutoConfiguration.class,
|
||||
ReactiveWebServerAutoConfiguration.class))
|
||||
ReactiveWebServerFactoryAutoConfiguration.class))
|
||||
.withUserConfiguration(ReactiveWebServerConfiguration.class)
|
||||
.run((context) -> {
|
||||
assertThat(context).hasSingleBean(TomcatMetrics.class);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.web.reactive;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration;
|
||||
import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext;
|
||||
import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
|
@ -50,7 +50,7 @@ public class ReactiveManagementContextFactoryTests {
|
|||
childContext.refresh();
|
||||
assertThat(childContext.getBean(TestConfiguration1.class)).isNotNull();
|
||||
assertThat(childContext.getBean(TestConfiguration2.class)).isNotNull();
|
||||
assertThat(childContext.getBean(ReactiveWebServerAutoConfiguration.class))
|
||||
assertThat(childContext.getBean(ReactiveWebServerFactoryAutoConfiguration.class))
|
||||
.isNotNull();
|
||||
|
||||
childContext.close();
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@ import org.springframework.util.ObjectUtils;
|
|||
@ConditionalOnClass(ReactiveHttpInputMessage.class)
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
@EnableConfigurationProperties(ServerProperties.class)
|
||||
@Import({ ReactiveWebServerAutoConfiguration.BeanPostProcessorsRegistrar.class,
|
||||
ReactiveWebServerConfiguration.TomcatAutoConfiguration.class,
|
||||
ReactiveWebServerConfiguration.JettyAutoConfiguration.class,
|
||||
ReactiveWebServerConfiguration.UndertowAutoConfiguration.class,
|
||||
ReactiveWebServerConfiguration.ReactorNettyAutoConfiguration.class })
|
||||
public class ReactiveWebServerAutoConfiguration {
|
||||
@Import({ ReactiveWebServerFactoryAutoConfiguration.BeanPostProcessorsRegistrar.class,
|
||||
ReactiveWebServerFactoryConfiguration.TomcatConfiguration.class,
|
||||
ReactiveWebServerFactoryConfiguration.JettyConfiguration.class,
|
||||
ReactiveWebServerFactoryConfiguration.UndertowConfiguration.class,
|
||||
ReactiveWebServerFactoryConfiguration.ReactorNettyConfiguration.class })
|
||||
public class ReactiveWebServerFactoryAutoConfiguration {
|
||||
|
||||
@ConditionalOnMissingBean
|
||||
@Bean
|
||||
|
|
@ -36,11 +36,11 @@ import org.springframework.context.annotation.Bean;
|
|||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
abstract class ReactiveWebServerConfiguration {
|
||||
abstract class ReactiveWebServerFactoryConfiguration {
|
||||
|
||||
@ConditionalOnMissingBean(ReactiveWebServerFactory.class)
|
||||
@ConditionalOnClass({ HttpServer.class })
|
||||
static class ReactorNettyAutoConfiguration {
|
||||
static class ReactorNettyConfiguration {
|
||||
|
||||
@Bean
|
||||
public NettyReactiveWebServerFactory NettyReactiveWebServerFactory() {
|
||||
|
|
@ -51,7 +51,7 @@ abstract class ReactiveWebServerConfiguration {
|
|||
|
||||
@ConditionalOnMissingBean(ReactiveWebServerFactory.class)
|
||||
@ConditionalOnClass({ org.apache.catalina.startup.Tomcat.class })
|
||||
static class TomcatAutoConfiguration {
|
||||
static class TomcatConfiguration {
|
||||
|
||||
@Bean
|
||||
public TomcatReactiveWebServerFactory tomcatReactiveWebServerFactory() {
|
||||
|
|
@ -62,7 +62,7 @@ abstract class ReactiveWebServerConfiguration {
|
|||
|
||||
@ConditionalOnMissingBean(ReactiveWebServerFactory.class)
|
||||
@ConditionalOnClass({ org.eclipse.jetty.server.Server.class })
|
||||
static class JettyAutoConfiguration {
|
||||
static class JettyConfiguration {
|
||||
|
||||
@Bean
|
||||
public JettyReactiveWebServerFactory jettyReactiveWebServerFactory() {
|
||||
|
|
@ -73,7 +73,7 @@ abstract class ReactiveWebServerConfiguration {
|
|||
|
||||
@ConditionalOnMissingBean(ReactiveWebServerFactory.class)
|
||||
@ConditionalOnClass({ Undertow.class })
|
||||
static class UndertowAutoConfiguration {
|
||||
static class UndertowConfiguration {
|
||||
|
||||
@Bean
|
||||
public UndertowReactiveWebServerFactory undertowReactiveWebServerFactory() {
|
||||
|
|
@ -86,7 +86,7 @@ import org.springframework.web.reactive.result.view.ViewResolver;
|
|||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
@ConditionalOnClass(WebFluxConfigurer.class)
|
||||
@ConditionalOnMissingBean({ WebFluxConfigurationSupport.class })
|
||||
@AutoConfigureAfter({ ReactiveWebServerAutoConfiguration.class,
|
||||
@AutoConfigureAfter({ ReactiveWebServerFactoryAutoConfiguration.class,
|
||||
CodecsAutoConfiguration.class, ValidationAutoConfiguration.class })
|
||||
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE + 10)
|
||||
public class WebFluxAutoConfiguration {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ import org.springframework.context.annotation.Configuration;
|
|||
@Configuration
|
||||
@ConditionalOnClass({ Servlet.class, ServerContainer.class })
|
||||
@ConditionalOnWebApplication(type = Type.REACTIVE)
|
||||
@AutoConfigureBefore(ReactiveWebServerAutoConfiguration.class)
|
||||
@AutoConfigureBefore(ReactiveWebServerFactoryAutoConfiguration.class)
|
||||
public class WebSocketReactiveAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration,\
|
|||
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration,\
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.springframework.boot.SpringApplication;
|
|||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
|
|
@ -72,7 +72,7 @@ public class MustacheAutoConfigurationReactiveIntegrationTests {
|
|||
}
|
||||
|
||||
@Configuration
|
||||
@Import({ ReactiveWebServerAutoConfiguration.class, WebFluxAutoConfiguration.class,
|
||||
@Import({ ReactiveWebServerFactoryAutoConfiguration.class, WebFluxAutoConfiguration.class,
|
||||
HttpHandlerAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class })
|
||||
@Controller
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ import org.springframework.http.server.reactive.HttpHandler;
|
|||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link ReactiveWebServerAutoConfiguration}.
|
||||
* Tests for {@link ReactiveWebServerFactoryAutoConfiguration}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
public class ReactiveWebServerAutoConfigurationTests {
|
||||
public class ReactiveWebServerFactoryAutoConfigurationTests {
|
||||
|
||||
private AnnotationConfigReactiveWebServerApplicationContext context;
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ public class ReactiveWebServerAutoConfigurationTests {
|
|||
|
||||
@Configuration
|
||||
@Import({ MockWebServerAutoConfiguration.class,
|
||||
ReactiveWebServerAutoConfiguration.class })
|
||||
ReactiveWebServerFactoryAutoConfiguration.class })
|
||||
protected static class BaseConfiguration {
|
||||
|
||||
@Bean
|
||||
|
|
@ -99,7 +99,7 @@ public class ReactiveWebServerAutoConfigurationTests {
|
|||
|
||||
@Configuration
|
||||
@Import({ MockWebServerAutoConfiguration.class,
|
||||
ReactiveWebServerAutoConfiguration.class })
|
||||
ReactiveWebServerFactoryAutoConfiguration.class })
|
||||
protected static class MissingHttpHandlerConfiguration {
|
||||
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
|
|||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
|
||||
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
|
|
@ -58,7 +58,7 @@ public class DefaultErrorWebExceptionHandlerIntegrationTests {
|
|||
|
||||
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
|
||||
.withConfiguration(AutoConfigurations.of(
|
||||
ReactiveWebServerAutoConfiguration.class,
|
||||
ReactiveWebServerFactoryAutoConfiguration.class,
|
||||
HttpHandlerAutoConfiguration.class, WebFluxAutoConfiguration.class,
|
||||
ErrorWebFluxAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
|
|
|
|||
Loading…
Reference in New Issue