Skip to content

Commit 6c3d64a

Browse files
committed
Test Thymeleaf auto-configuration backs off without spring integration
See gh-16341
1 parent 29b1b38 commit 6c3d64a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.thymeleaf.templateresolver.ITemplateResolver;
3939

4040
import org.springframework.boot.autoconfigure.AutoConfigurations;
41+
import org.springframework.boot.test.context.FilteredClassLoader;
4142
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
4243
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
4344
import org.springframework.boot.test.rule.OutputCapture;
@@ -78,6 +79,14 @@ public class ThymeleafServletAutoConfigurationTests {
7879
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
7980
.withConfiguration(AutoConfigurations.of(ThymeleafAutoConfiguration.class));
8081

82+
@Test
83+
public void autoConfigurationBackOffWithoutThymeleafSpring() {
84+
this.contextRunner
85+
.withClassLoader(new FilteredClassLoader("org.thymeleaf.spring5"))
86+
.run((context) -> assertThat(context)
87+
.doesNotHaveBean(TemplateEngine.class));
88+
}
89+
8190
@Test
8291
public void createFromConfigClass() {
8392
this.contextRunner.withPropertyValues("spring.thymeleaf.mode:HTML",

0 commit comments

Comments
 (0)