Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@WebFluxTest does not enable auto-configuration for any reactive template engines #16170

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,6 +37,7 @@
* Tests for the auto-configuration imported by {@link WebFluxTest}.
*
* @author Stephane Nicoll
* @author Artsiom Yudovin
*/
@RunWith(SpringRunner.class)
@WebFluxTest
Expand All @@ -54,6 +58,24 @@ 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));
}

@Test
public void whatever() {
WebTestClient client = this.applicationContext.getBean(WebTestClient.class);
Expand Down