Skip to content

Commit 5101342

Browse files
ayudovinsnicoll
authored andcommitted
Add support for Mustache, FreeMarker and Thymeleaf in WebFluxTest
See gh-16170
1 parent 078bd89 commit 5101342

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfig
9595
# AutoConfigureWebFlux auto-configuration imports
9696
org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebFlux=\
9797
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration,\
98+
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration,\
9899
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration,\
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

Lines changed: 22 additions & 0 deletions
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)