Merge branch '3.4.x'
This commit is contained in:
commit
2f73406dff
|
@ -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>");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue