mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge branch '2.5.x' into 2.6.x
Closes gh-31098
This commit is contained in:
commit
e407bae8c8
@ -27,6 +27,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.thymeleaf.TemplateEngine;
|
||||
import org.thymeleaf.context.Context;
|
||||
import org.thymeleaf.context.IContext;
|
||||
import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect;
|
||||
import org.thymeleaf.extras.springsecurity5.util.SpringSecurityContextUtils;
|
||||
import org.thymeleaf.spring5.ISpringWebFluxTemplateEngine;
|
||||
import org.thymeleaf.spring5.SpringWebFluxTemplateEngine;
|
||||
@ -36,6 +37,7 @@ import org.thymeleaf.spring5.view.reactive.ThymeleafReactiveViewResolver;
|
||||
import org.thymeleaf.templateresolver.ITemplateResolver;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.test.context.FilteredClassLoader;
|
||||
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||
@ -217,6 +219,12 @@ class ThymeleafReactiveAutoConfigurationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void securityDialectAutoConfigurationBacksOffWithoutSpringSecurity() {
|
||||
this.contextRunner.withClassLoader(new FilteredClassLoader("org.springframework.security"))
|
||||
.run((context) -> assertThat(context).doesNotHaveBean(SpringSecurityDialect.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void renderTemplate() {
|
||||
this.contextRunner.run((context) -> {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -31,6 +31,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.thymeleaf.TemplateEngine;
|
||||
import org.thymeleaf.context.Context;
|
||||
import org.thymeleaf.context.WebContext;
|
||||
import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect;
|
||||
import org.thymeleaf.spring5.SpringTemplateEngine;
|
||||
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
|
||||
import org.thymeleaf.spring5.view.ThymeleafView;
|
||||
@ -231,6 +232,12 @@ class ThymeleafServletAutoConfigurationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void securityDialectAutoConfigurationBacksOffWithoutSpringSecurity() {
|
||||
this.contextRunner.withClassLoader(new FilteredClassLoader("org.springframework.security"))
|
||||
.run((context) -> assertThat(context).doesNotHaveBean(SpringSecurityDialect.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void renderTemplate() {
|
||||
this.contextRunner.run((context) -> {
|
||||
|
Loading…
Reference in New Issue
Block a user