mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-03 03:43:54 +01:00
Merge branch '3.3.x' into 3.4.x
This commit is contained in:
+2
-2
@@ -214,7 +214,7 @@ class ThymeleafReactiveAutoConfigurationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@WithResource(name = "templates/security-dialect.html",
|
@WithResource(name = "templates/security-dialect.html",
|
||||||
content = "<html><body><div sec:authentication=\"name\"></div></body></html>\n")
|
content = "<html><body><div sec:authentication=\"name\"></div></body></html>")
|
||||||
void useSecurityDialect() {
|
void useSecurityDialect() {
|
||||||
this.contextRunner.run((context) -> {
|
this.contextRunner.run((context) -> {
|
||||||
ISpringWebFluxTemplateEngine engine = context.getBean(ISpringWebFluxTemplateEngine.class);
|
ISpringWebFluxTemplateEngine engine = context.getBean(ISpringWebFluxTemplateEngine.class);
|
||||||
@@ -225,7 +225,7 @@ class ThymeleafReactiveAutoConfigurationTests {
|
|||||||
WebContext attrs = new WebContext(SpringWebFluxWebApplication.buildApplication(null)
|
WebContext attrs = new WebContext(SpringWebFluxWebApplication.buildApplication(null)
|
||||||
.buildExchange(exchange, Locale.US, MediaType.TEXT_HTML, StandardCharsets.UTF_8));
|
.buildExchange(exchange, Locale.US, MediaType.TEXT_HTML, StandardCharsets.UTF_8));
|
||||||
String result = engine.process("security-dialect", attrs);
|
String result = engine.process("security-dialect", attrs);
|
||||||
assertThat(result).isEqualTo("<html><body><div>alice</div></body></html>" + System.lineSeparator());
|
assertThat(result).isEqualTo("<html><body><div>alice</div></body></html>");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -239,7 +239,7 @@ class ThymeleafServletAutoConfigurationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@WithResource(name = "templates/security-dialect.html",
|
@WithResource(name = "templates/security-dialect.html",
|
||||||
content = "<html><body><div sec:authentication=\"name\"></div></body></html>\n")
|
content = "<html><body><div sec:authentication=\"name\"></div></body></html>")
|
||||||
void useSecurityDialect() {
|
void useSecurityDialect() {
|
||||||
this.contextRunner.run((context) -> {
|
this.contextRunner.run((context) -> {
|
||||||
TemplateEngine engine = context.getBean(TemplateEngine.class);
|
TemplateEngine engine = context.getBean(TemplateEngine.class);
|
||||||
@@ -251,7 +251,7 @@ class ThymeleafServletAutoConfigurationTests {
|
|||||||
SecurityContextHolder
|
SecurityContextHolder
|
||||||
.setContext(new SecurityContextImpl(new TestingAuthenticationToken("alice", "admin")));
|
.setContext(new SecurityContextImpl(new TestingAuthenticationToken("alice", "admin")));
|
||||||
String result = engine.process("security-dialect", attrs);
|
String result = engine.process("security-dialect", attrs);
|
||||||
assertThat(result).isEqualTo("<html><body><div>alice</div></body></html>" + System.lineSeparator());
|
assertThat(result).isEqualTo("<html><body><div>alice</div></body></html>");
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
SecurityContextHolder.clearContext();
|
SecurityContextHolder.clearContext();
|
||||||
|
|||||||
Reference in New Issue
Block a user