Skip to content

Commit 015de55

Browse files
committed
Merge pull request spring-projects#16170 from ayudovin
* pr/16170: Polish contribution Add support for Mustache, FreeMarker and Thymeleaf in WebFluxTest
2 parents 078bd89 + 161c0b9 commit 015de55

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,11 @@ org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfig
9494

9595
# AutoConfigureWebFlux auto-configuration imports
9696
org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebFlux=\
97-
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration,\
9897
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration,\
98+
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration,\
99+
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration,\
100+
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration,\
101+
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,\
99102
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration,\
100103
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration
101104

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAutoConfigurationIntegrationTests.java

+22
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
import org.springframework.beans.factory.annotation.Autowired;
2323
import org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration;
24+
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
25+
import org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration;
26+
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
2427
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
2528
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
2629
import org.springframework.context.ApplicationContext;
@@ -33,6 +36,7 @@
3336
* Tests for the auto-configuration imported by {@link WebFluxTest}.
3437
*
3538
* @author Stephane Nicoll
39+
* @author Artsiom Yudovin
3640
*/
3741
@RunWith(SpringRunner.class)
3842
@WebFluxTest
@@ -53,4 +57,22 @@ public void validationAutoConfigurationIsImported() {
5357
.has(importedAutoConfiguration(ValidationAutoConfiguration.class));
5458
}
5559

60+
@Test
61+
public void mustacheAutoConfigurationIsImported() {
62+
assertThat(this.applicationContext)
63+
.has(importedAutoConfiguration(MustacheAutoConfiguration.class));
64+
}
65+
66+
@Test
67+
public void freemarkerAutoConfigurationIsImported() {
68+
assertThat(this.applicationContext)
69+
.has(importedAutoConfiguration(FreeMarkerAutoConfiguration.class));
70+
}
71+
72+
@Test
73+
public void thymeleafAutoConfigurationIsImported() {
74+
assertThat(this.applicationContext)
75+
.has(importedAutoConfiguration(ThymeleafAutoConfiguration.class));
76+
}
77+
5678
}

0 commit comments

Comments
 (0)