Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private boolean hasAnyOtherProperty() {
}

private StandardStackTracePrinter createStandardPrinter() {
StandardStackTracePrinter printer = (root() != Root.FIRST) ? StandardStackTracePrinter.rootFirst()
StandardStackTracePrinter printer = (root() == Root.FIRST) ? StandardStackTracePrinter.rootFirst()
: StandardStackTracePrinter.rootLast();
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
printer = map.from(this::maxLength).to(printer, StandardStackTracePrinter::withMaximumLength);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,11 @@ void createPrinterWhenStandardAppliesCustomizations() {
.withLineSeparator("\n");
String actual = TestException.withoutLineNumbers(printer.printStackTraceToString(exception));
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)
... 2 filtered
Suppressed: java.lang.RuntimeException: supressed
at o...""");
java.lang.RuntimeException: root
at org.springframework.boot.logging.TestException.createTestException(TestException.java:NN)
at org.springframework.boot.logging.TestException$CreatorThread.run(TestException.java:NN)
Wrapped by: java.lang.RuntimeException: cause
at org.springframework.boot.log...""");
}

@Test
Expand All @@ -184,8 +183,7 @@ void createPrinterWhenClassNameInjectsConfiguredPrinter() {
true, null);
StackTracePrinter printer = properties.createPrinter();
String actual = TestException.withoutLineNumbers(printer.printStackTraceToString(exception));
assertThat(actual).isEqualTo("RuntimeExceptionexception! at org.spr...");

assertThat(actual).isEqualTo("RuntimeExceptionroot! at org.springfr...");
}

@Test
Expand Down
Loading