Fix "Used nested format for ECS structure logging" test on Windows
See gh-45063
This commit is contained in:
@@ -94,14 +94,13 @@ class ElasticCommonSchemaStructuredLogFormatterTests extends AbstractStructuredL
|
||||
expectedError.put("message", "Boom");
|
||||
assertThat(error).containsAllEntriesOf(expectedError);
|
||||
String stackTrace = (String) error.get("stack_trace");
|
||||
assertThat(stackTrace)
|
||||
.startsWith(String.format("java.lang.RuntimeException: Boom%n\tat org.springframework.boot.logging.log4j2."
|
||||
+ "ElasticCommonSchemaStructuredLogFormatterTests.shouldFormatException"));
|
||||
assertThat(json).contains(String
|
||||
.format("java.lang.RuntimeException: Boom%n\\tat org.springframework.boot.logging.log4j2."
|
||||
+ "ElasticCommonSchemaStructuredLogFormatterTests.shouldFormatException")
|
||||
.replace("\n", "\\n")
|
||||
.replace("\r", "\\r"));
|
||||
assertThat(stackTrace).startsWith(
|
||||
"""
|
||||
java.lang.RuntimeException: Boom
|
||||
\tat org.springframework.boot.logging.log4j2.ElasticCommonSchemaStructuredLogFormatterTests.shouldFormatException""");
|
||||
assertThat(json).contains(
|
||||
"""
|
||||
java.lang.RuntimeException: Boom\\n\\tat org.springframework.boot.logging.log4j2.ElasticCommonSchemaStructuredLogFormatterTests.shouldFormatException""");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user