Browse Source

Rename ReactiveWebServerAutoConfiguration

Closes gh-12086
pull/12068/merge
Andy Wilkinson 8 years ago
parent
commit
fe4c8f95ed
  1. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementContextFactory.java
  2. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java
  3. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementContextFactoryTests.java
  4. 12
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfiguration.java
  5. 10
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java
  6. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java
  7. 4
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/reactive/WebSocketReactiveAutoConfiguration.java
  8. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
  9. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationReactiveIntegrationTests.java
  10. 8
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java
  11. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementContextFactory.java

@ -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.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 { @@ -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;

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java

@ -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.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 { @@ -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);

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementContextFactoryTests.java

@ -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.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 { @@ -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();

12
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfiguration.java → spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfiguration.java

@ -50,12 +50,12 @@ import org.springframework.util.ObjectUtils; @@ -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

10
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerConfiguration.java → spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java

@ -36,11 +36,11 @@ import org.springframework.context.annotation.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 { @@ -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 { @@ -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 { @@ -73,7 +73,7 @@ abstract class ReactiveWebServerConfiguration {
@ConditionalOnMissingBean(ReactiveWebServerFactory.class)
@ConditionalOnClass({ Undertow.class })
static class UndertowAutoConfiguration {
static class UndertowConfiguration {
@Bean
public UndertowReactiveWebServerFactory undertowReactiveWebServerFactory() {

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java

@ -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)
@ConditionalOnClass(WebFluxConfigurer.class)
@ConditionalOnMissingBean({ WebFluxConfigurationSupport.class })
@AutoConfigureAfter({ ReactiveWebServerAutoConfiguration.class,
@AutoConfigureAfter({ ReactiveWebServerFactoryAutoConfiguration.class,
CodecsAutoConfiguration.class, ValidationAutoConfiguration.class })
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE + 10)
public class WebFluxAutoConfiguration {

4
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/reactive/WebSocketReactiveAutoConfiguration.java

@ -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.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; @@ -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

2
spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories

@ -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.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,\

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationReactiveIntegrationTests.java

@ -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.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 { @@ -72,7 +72,7 @@ public class MustacheAutoConfigurationReactiveIntegrationTests {
}
@Configuration
@Import({ ReactiveWebServerAutoConfiguration.class, WebFluxAutoConfiguration.class,
@Import({ ReactiveWebServerFactoryAutoConfiguration.class, WebFluxAutoConfiguration.class,
HttpHandlerAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class })
@Controller

8
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java → spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java

@ -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;
/**
* 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 { @@ -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 { @@ -99,7 +99,7 @@ public class ReactiveWebServerAutoConfigurationTests {
@Configuration
@Import({ MockWebServerAutoConfiguration.class,
ReactiveWebServerAutoConfiguration.class })
ReactiveWebServerFactoryAutoConfiguration.class })
protected static class MissingHttpHandlerConfiguration {
}

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java

@ -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.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 { @@ -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…
Cancel
Save