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 9a4c59056c..3cd1012860 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 @@ -311,7 +311,7 @@ class StandardStackTracePrinterTests { StandardStackTracePrinter printer = StandardStackTracePrinter.rootLast() .withFrameFormatter( (element) -> ClassUtils.getShortName(element.getClassName()) + "." + element.getMethodName()); - assertThat(printer.printStackTraceToString(exception)).isEqualTo(""" + assertThat(printer.printStackTraceToString(exception)).isEqualToNormalizingNewlines(""" java.lang.RuntimeException: exception at TestException.actualCreateException at TestException.createException @@ -335,7 +335,7 @@ class StandardStackTracePrinterTests { Throwable exception = TestException.create(); StandardStackTracePrinter printer = StandardStackTracePrinter.rootLast() .withHashes((frame) -> Objects.hash(frame.getClassName(), frame.getMethodName())); - assertThat(printer.printStackTraceToString(exception)).isEqualTo(""" + assertThat(printer.printStackTraceToString(exception)).isEqualToNormalizingNewlines(""" <#cc3eebec> java.lang.RuntimeException: exception at org.springframework.boot.logging.TestException.actualCreateException(TestException.java:63) at org.springframework.boot.logging.TestException.createException(TestException.java:59) @@ -384,7 +384,7 @@ class StandardStackTracePrinterTests { private void assertThatCleanedStackTraceMatches(StandardStackTracePrinter printer, Throwable throwable, String expected) { String actual = printer.printStackTraceToString(throwable); - assertThat(TestException.withoutLineNumbers(actual)).isEqualTo(expected); + assertThat(TestException.withoutLineNumbers(actual)).isEqualToNormalizingNewlines(expected); } } 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 90b243d349..7b3a370c50 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 @@ -146,7 +146,7 @@ class StructuredLoggingJsonPropertiesTests { StackTrace properties = new StackTrace(null, Root.FIRST, 300, 2, true, false); StackTracePrinter printer = properties.createPrinter(); String actual = TestException.withoutLineNumbers(printer.printStackTraceToString(exception)); - assertThat(actual).isEqualTo(""" + assertThat(actual).isEqualToNormalizingNewlines(""" java.lang.RuntimeException: exception at org.springframework.boot.logging.TestException.actualCreateException(TestException.java:NN) at org.springframework.boot.logging.TestException.createException(TestException.java:NN)