From 51013421f2355cfc9a9514ecb4ca700f5edde1d8 Mon Sep 17 00:00:00 2001 From: ayudovin Date: Fri, 8 Mar 2019 13:44:53 +0300 Subject: [PATCH] Add support for Mustache, FreeMarker and Thymeleaf in WebFluxTest See gh-16170 --- .../main/resources/META-INF/spring.factories | 3 +++ ...TestAutoConfigurationIntegrationTests.java | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+) 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 4ef428df7fe7..a7922104dcdf 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 @@ -95,7 +95,10 @@ org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfig # AutoConfigureWebFlux auto-configuration imports org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebFlux=\ org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration,\ +org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration,\ org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration,\ +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 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 255872814638..4c832955f85b 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 @@ -21,6 +21,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration; +import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration; +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.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.context.ApplicationContext; @@ -33,6 +36,7 @@ * Tests for the auto-configuration imported by {@link WebFluxTest}. * * @author Stephane Nicoll + * @author Artsiom Yudovin */ @RunWith(SpringRunner.class) @WebFluxTest @@ -53,4 +57,22 @@ public void validationAutoConfigurationIsImported() { .has(importedAutoConfiguration(ValidationAutoConfiguration.class)); } + @Test + public void mustacheAutoConfigurationIsImported() { + assertThat(this.applicationContext) + .has(importedAutoConfiguration(MustacheAutoConfiguration.class)); + } + + @Test + public void freemarkerAutoConfigurationIsImported() { + assertThat(this.applicationContext) + .has(importedAutoConfiguration(FreeMarkerAutoConfiguration.class)); + } + + @Test + public void thymeleafAutoConfigurationIsImported() { + assertThat(this.applicationContext) + .has(importedAutoConfiguration(ThymeleafAutoConfiguration.class)); + } + }