Fix JsonLoggerTests.testJsonInStacktraceMessageIsSplitted backport#39830 #39834

a test was splitting a json log message with a wrong line separator.
Using System.lineSeparator consistently prevents this problem
closes #39829
backport#39830
This commit is contained in:
Przemyslaw Gomulka 2019-03-08 16:34:17 +01:00 committed by GitHub
parent e6b9262a31
commit c23ff0803e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ public class JsonLoggerTests extends ESTestCase {
logLine("file", Level.ERROR, "sample-name", "test", "error message " + json), logLine("file", Level.ERROR, "sample-name", "test", "error message " + json),
//stacktrace field will have each json line will in a separate array element //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))
) )
)); ));
} }