diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring.factories index cfa9df1d2890..d05127f94215 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring.factories @@ -100,7 +100,8 @@ org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration,\ org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration,\ org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,\ org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration,\ -org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration +org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration,\ +org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration # AutoConfigureMockMvc auto-configuration imports org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc=\ diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleWebExceptionHandler.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleWebExceptionHandler.java index e4eef3347fbf..fb1d09cbc884 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleWebExceptionHandler.java @@ -18,6 +18,8 @@ import reactor.core.publisher.Mono; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.server.ServerWebExchange; @@ -27,8 +29,10 @@ * Example {@link WebExceptionHandler} used with {@link WebFluxTest} tests. * * @author Madhura Bhave + * @author Ali Dehghani */ @Component +@Order(Ordered.HIGHEST_PRECEDENCE) public class ExampleWebExceptionHandler implements WebExceptionHandler { @Override diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAutoConfigurationIntegrationTests.java index 7f5773404853..b33a8dfa2c42 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAutoConfigurationIntegrationTests.java @@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration; import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration; import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration; +import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.context.ApplicationContext; import org.springframework.test.context.junit4.SpringRunner; @@ -37,6 +38,7 @@ * * @author Stephane Nicoll * @author Artsiom Yudovin + * @author Ali Dehghani */ @RunWith(SpringRunner.class) @WebFluxTest @@ -75,4 +77,10 @@ public void thymeleafAutoConfigurationIsImported() { .has(importedAutoConfiguration(ThymeleafAutoConfiguration.class)); } + @Test + public void errorWebFluxAutoConfigurationIsImported() { + assertThat(this.applicationContext) + .has(importedAutoConfiguration(ErrorWebFluxAutoConfiguration.class)); + } + }