From c1ffad259a8bc6287a963748a4e6663009ea55b7 Mon Sep 17 00:00:00 2001 From: Matteo Mara Date: Thu, 2 Jun 2022 11:37:36 +0200 Subject: [PATCH] SONAR-16447 Fix AuditLogs download error due to JSONException --- .../test/java/org/sonar/db/audit/model/UserNewValueTest.java | 2 +- .../src/testFixtures/java/org/sonar/db/audit/AuditTesting.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/audit/model/UserNewValueTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/audit/model/UserNewValueTest.java index 13a497e334e..03eae269928 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/audit/model/UserNewValueTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/audit/model/UserNewValueTest.java @@ -35,7 +35,7 @@ public class UserNewValueTest { userDto.setName("name"); userDto.setEmail("name@email.com"); userDto.setActive(true); - userDto.setScmAccounts("github-account"); + userDto.setScmAccounts("\ngithub-account\n"); userDto.setExternalId("name"); userDto.setExternalLogin("name"); userDto.setExternalIdentityProvider("github"); diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/audit/AuditTesting.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/audit/AuditTesting.java index 8bc48c6508d..d5e17a0bfec 100644 --- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/audit/AuditTesting.java +++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/audit/AuditTesting.java @@ -44,7 +44,7 @@ public class AuditTesting { auditDto.setUuid(randomAlphanumeric(20)); auditDto.setUserUuid(randomAlphanumeric(40)); auditDto.setUserLogin(randomAlphanumeric(40)); - auditDto.setNewValue("{ \"someKey\": \"someValue\" }"); + auditDto.setNewValue("{ \"someKey\": \"someValue\", \"anotherKey\": \"anotherValue\\\n\t\b\f\r\"}"); auditDto.setOperation(operation); auditDto.setCategory("category"); auditDto.setCreatedAt(createdAt); -- 2.39.5