aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/test/java
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2024-05-07 16:17:25 +0200
committersonartech <sonartech@sonarsource.com>2024-05-13 20:02:41 +0000
commit6e33df0cc2e8e243fef6eb4486a03e84620d51d3 (patch)
tree743270422e3316ae641eed03e1ad3781df6d8f61 /sonar-scanner-engine/src/test/java
parent07d1d8cd3f8f95ac40022916717481b43727ec03 (diff)
downloadsonarqube-6e33df0cc2e8e243fef6eb4486a03e84620d51d3.tar.gz
sonarqube-6e33df0cc2e8e243fef6eb4486a03e84620d51d3.zip
Fix stacktrace in the Json output
Diffstat (limited to 'sonar-scanner-engine/src/test/java')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerLogbackEncoderTest.java10
1 files changed, 6 insertions, 4 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 e63985da428..d752b67b4c5 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
@@ -30,9 +30,9 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
class ScannerLogbackEncoderTest {
-
+
ScannerLogbackEncoder underTest = new ScannerLogbackEncoder();
-
+
@Test
void no_headers_and_footers() {
assertThat(underTest.headerBytes()).isEmpty();
@@ -70,7 +70,9 @@ class ScannerLogbackEncoderTest {
var bytes = underTest.encode(logEvent);
- assertThat(new String(bytes, StandardCharsets.UTF_8)).isEqualTo("{\"level\":\"DEBUG\",\"message\":\"message\",\"stacktrace\":\"java.lang.IllegalArgumentException: foo\\n\"}\n");
+ 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");
}
-} \ No newline at end of file
+}