Skip to content

Commit e407bae

Browse files
committed
Merge branch '2.5.x' into 2.6.x
Closes gh-31098
2 parents e26c58b + 5e78bef commit e407bae

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.thymeleaf.TemplateEngine;
2828
import org.thymeleaf.context.Context;
2929
import org.thymeleaf.context.IContext;
30+
import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect;
3031
import org.thymeleaf.extras.springsecurity5.util.SpringSecurityContextUtils;
3132
import org.thymeleaf.spring5.ISpringWebFluxTemplateEngine;
3233
import org.thymeleaf.spring5.SpringWebFluxTemplateEngine;
@@ -36,6 +37,7 @@
3637
import org.thymeleaf.templateresolver.ITemplateResolver;
3738

3839
import org.springframework.boot.autoconfigure.AutoConfigurations;
40+
import org.springframework.boot.test.context.FilteredClassLoader;
3941
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
4042
import org.springframework.boot.test.system.CapturedOutput;
4143
import org.springframework.boot.test.system.OutputCaptureExtension;
@@ -217,6 +219,12 @@ void useSecurityDialect() {
217219
});
218220
}
219221

222+
@Test
223+
void securityDialectAutoConfigurationBacksOffWithoutSpringSecurity() {
224+
this.contextRunner.withClassLoader(new FilteredClassLoader("org.springframework.security"))
225+
.run((context) -> assertThat(context).doesNotHaveBean(SpringSecurityDialect.class));
226+
}
227+
220228
@Test
221229
void renderTemplate() {
222230
this.contextRunner.run((context) -> {

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
3131
import org.thymeleaf.TemplateEngine;
3232
import org.thymeleaf.context.Context;
3333
import org.thymeleaf.context.WebContext;
34+
import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect;
3435
import org.thymeleaf.spring5.SpringTemplateEngine;
3536
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
3637
import org.thymeleaf.spring5.view.ThymeleafView;
@@ -231,6 +232,12 @@ void useSecurityDialect() {
231232
});
232233
}
233234

235+
@Test
236+
void securityDialectAutoConfigurationBacksOffWithoutSpringSecurity() {
237+
this.contextRunner.withClassLoader(new FilteredClassLoader("org.springframework.security"))
238+
.run((context) -> assertThat(context).doesNotHaveBean(SpringSecurityDialect.class));
239+
}
240+
234241
@Test
235242
void renderTemplate() {
236243
this.contextRunner.run((context) -> {

0 commit comments

Comments
 (0)