diff options
author | antoine.vinot <antoine.vinot@sonarsource.com> | 2024-12-03 10:22:23 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-12-03 20:03:22 +0000 |
commit | 745818998a1d73e9f50caacea56d89f6e0f01bb6 (patch) | |
tree | c1d2dd20ec7b0514b35c116336b640bdf0004f41 /sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerLogbackEncoderTest.java | |
parent | 725ac27793de60b55c5dbffdef3d10eeb3f9e150 (diff) | |
download | sonarqube-745818998a1d73e9f50caacea56d89f6e0f01bb6.tar.gz sonarqube-745818998a1d73e9f50caacea56d89f6e0f01bb6.zip |
SONAR-23432 Fix failing tests on Windows in scanner-engine
Diffstat (limited to 'sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerLogbackEncoderTest.java')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerLogbackEncoderTest.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerLogbackEncoderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerLogbackEncoderTest.java index d752b67b4c5..ea0028bf90a 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerLogbackEncoderTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerLogbackEncoderTest.java @@ -70,9 +70,11 @@ class ScannerLogbackEncoderTest { var bytes = underTest.encode(logEvent); - assertThat(new String(bytes, StandardCharsets.UTF_8)) - .startsWith( - "{\"level\":\"DEBUG\",\"message\":\"message\",\"stacktrace\":\"java.lang.IllegalArgumentException: foo\\n\\tat org.sonar.scanner.bootstrap.ScannerLogbackEncoderTest.should_encode_with_stacktrace"); + String encodedLog = new String(bytes, StandardCharsets.UTF_8); + assertThat(encodedLog).contains("\"level\":\"DEBUG\"") + .contains("\"message\":\"message\"") + .contains("\"stacktrace\":\"java.lang.IllegalArgumentException: foo") + .contains("at org.sonar.scanner.bootstrap.ScannerLogbackEncoderTest.should_encode_with_stacktrace"); } } |