]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15501 Fix response example for `api/project_analyses/search` endpoint + unit...
authorKlaudio Sinani <klaudio.sinani@sonarsource.com>
Thu, 4 Nov 2021 14:30:52 +0000 (15:30 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 4 Nov 2021 20:03:25 +0000 (20:03 +0000)
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/projectanalysis/ws/search-example.json
server/sonar-webserver-webapi/src/test/java/org/sonar/server/projectanalysis/ws/SearchActionTest.java

index e9dd58e74704ad5b8740b57776b0b699423d340d..27fa8cfadf9dbe7b0ee38503e5f7860e522c0c94 100644 (file)
       "manualNewCodePeriodBaseline": true,
       "events": [
         {
-          "key": "E11",
+          "key": "AXt91FkXy_c4CIP4ds6A",
           "category": "QUALITY_GATE",
-          "name": "Quality Gate is Red (was Orange)",
-          "description": "Coverage is \u003c 80%"
+          "name": "Failed",
+          "description": "Coverage on New Code < 85, Reliability Rating > 4, Maintainability Rating on New Code > 1, Reliability Rating on New Code > 1, Security Rating on New Code > 1, Duplicated Lines (%) on New Code > 3"
         },
         {
-          "key": "E12",
+          "key": "AXx_QFJ6Wa8wkfuJ6r5P",
           "category": "VERSION",
           "name": "6.3"
         }
           "qualityGate": {
             "status": "ERROR",
             "stillFailing": true,
-            "failing": [{
-              "key": "app1",
-              "name": "My project",
-              "branch": "master"
-            },{
-              "key": "app2",
-              "name": "Another project",
-              "branch": "master"
-            }
+            "failing": [
+              {
+                "key": "app1",
+                "name": "My project",
+                "branch": "master"
+              },
+              {
+                "key": "app2",
+                "name": "Another project",
+                "branch": "master"
+              }
             ]
           }
         }
index c4d6e850c0dbc184489b2a18b6518e3c117b00cf..d2b6938ac082c22a73bcc02f5921152680d24206 100644 (file)
@@ -152,11 +152,11 @@ public class SearchActionTest {
       .setType(NewCodePeriodType.SPECIFIC_ANALYSIS)
       .setValue(a1.getUuid()));
     db.commit();
-    db.events().insertEvent(newEvent(a1).setUuid("E11")
-      .setName("Quality Gate is Red (was Orange)")
+    db.events().insertEvent(newEvent(a1).setUuid("AXt91FkXy_c4CIP4ds6A")
+      .setName("Failed")
       .setCategory(QUALITY_GATE.getLabel())
-      .setDescription("Coverage is < 80%"));
-    db.events().insertEvent(newEvent(a1).setUuid("E12")
+      .setDescription("Coverage on New Code < 85, Reliability Rating > 4, Maintainability Rating on New Code > 1, Reliability Rating on New Code > 1, Security Rating on New Code > 1, Duplicated Lines (%) on New Code > 3"));
+    db.events().insertEvent(newEvent(a1).setUuid("AXx_QFJ6Wa8wkfuJ6r5P")
       .setName("6.3").setCategory(VERSION.getLabel()));
     db.events().insertEvent(newEvent(a2).setUuid("E21")
       .setName("Quality Profile changed to Sonar Way")