Skip to content

Commit 60624e8

Browse files
committed
Avoid problems with platform-specific line endings
See gh-44512
1 parent 55c410a commit 60624e8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void useJava8TimeDialect() {
214214

215215
@Test
216216
@WithResource(name = "templates/security-dialect.html",
217-
content = "<html><body><div sec:authentication=\"name\"></div></body></html>\n")
217+
content = "<html><body><div sec:authentication=\"name\"></div></body></html>")
218218
void useSecurityDialect() {
219219
this.contextRunner.run((context) -> {
220220
ISpringWebFluxTemplateEngine engine = context.getBean(ISpringWebFluxTemplateEngine.class);
@@ -225,7 +225,7 @@ void useSecurityDialect() {
225225
WebContext attrs = new WebContext(SpringWebFluxWebApplication.buildApplication(null)
226226
.buildExchange(exchange, Locale.US, MediaType.TEXT_HTML, StandardCharsets.UTF_8));
227227
String result = engine.process("security-dialect", attrs);
228-
assertThat(result).isEqualTo("<html><body><div>alice</div></body></html>" + System.lineSeparator());
228+
assertThat(result).isEqualTo("<html><body><div>alice</div></body></html>");
229229
});
230230
}
231231

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void useJava8TimeDialect() {
239239

240240
@Test
241241
@WithResource(name = "templates/security-dialect.html",
242-
content = "<html><body><div sec:authentication=\"name\"></div></body></html>\n")
242+
content = "<html><body><div sec:authentication=\"name\"></div></body></html>")
243243
void useSecurityDialect() {
244244
this.contextRunner.run((context) -> {
245245
TemplateEngine engine = context.getBean(TemplateEngine.class);
@@ -251,7 +251,7 @@ void useSecurityDialect() {
251251
SecurityContextHolder
252252
.setContext(new SecurityContextImpl(new TestingAuthenticationToken("alice", "admin")));
253253
String result = engine.process("security-dialect", attrs);
254-
assertThat(result).isEqualTo("<html><body><div>alice</div></body></html>" + System.lineSeparator());
254+
assertThat(result).isEqualTo("<html><body><div>alice</div></body></html>");
255255
}
256256
finally {
257257
SecurityContextHolder.clearContext();

0 commit comments

Comments
 (0)