Commit fe4c8f95 authored by Andy Wilkinson's avatar Andy Wilkinson

Rename ReactiveWebServerAutoConfiguration

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