From 21d9803f9dd8c3da4335c45fb492b091d89560ea Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Fri, 8 Mar 2019 16:33:59 +0100 Subject: [PATCH] Fix JsonLoggerTests.testJsonInStacktraceMessageIsSplitted backport#39830 #39833 a test was splitting a json log message with a wrong line separator. Using System.lineSeparator consistently prevents this problem closes #39829 backport#39830 --- .../java/org/elasticsearch/common/logging/JsonLoggerTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java index 1f7479dd3dee5..bbb20737c4708 100644 --- a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java +++ b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java @@ -174,7 +174,7 @@ public void testJsonInStacktraceMessageIsSplitted() throws IOException { logLine("file", Level.ERROR, "sample-name", "test", "error message " + json), //stacktrace field will have each json line will in a separate array element - stacktraceWith(("java.lang.Exception: " + json).split("\n")) + stacktraceWith(("java.lang.Exception: " + json).split(LINE_SEPARATOR)) ) )); }