diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/StandardStackTracePrinterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/StandardStackTracePrinterTests.java index 3cd1012860..3150f15787 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/StandardStackTracePrinterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/StandardStackTracePrinterTests.java @@ -263,8 +263,7 @@ class StandardStackTracePrinterTests { void withLineSeparatorUsesLineSeparator() { Throwable exception = TestException.create(); StandardStackTracePrinter printer = StandardStackTracePrinter.rootLast().withLineSeparator("!"); - assertThatCleanedStackTraceMatches(printer, exception, - standardStackTrace().replace(System.lineSeparator(), "!")); + assertThatCleanedStackTraceMatches(printer, exception, standardStackTrace().replace("\n", "!")); } @Test diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java index 7b3a370c50..7bd10b42f1 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java @@ -144,7 +144,8 @@ class StructuredLoggingJsonPropertiesTests { void createPrinterWhenStandardAppliesCustomizations() { Exception exception = TestException.create(); StackTrace properties = new StackTrace(null, Root.FIRST, 300, 2, true, false); - StackTracePrinter printer = properties.createPrinter(); + StackTracePrinter printer = ((StandardStackTracePrinter) properties.createPrinter()) + .withLineSeparator("\n"); String actual = TestException.withoutLineNumbers(printer.printStackTraceToString(exception)); assertThat(actual).isEqualToNormalizingNewlines(""" java.lang.RuntimeException: exception