]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8039 Do not return valid hash in example
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 9 Sep 2016 09:38:29 +0000 (11:38 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 9 Sep 2016 09:39:38 +0000 (11:39 +0200)
server/sonar-server/src/main/resources/org/sonar/server/license/ws/list-example.json
server/sonar-server/src/test/java/org/sonar/server/license/ws/ListActionTest.java

index 62a99ef1e530cdc0c16a423c8aedd8b62143004d..f8a7526000d7542368d0ae3cbac37cd09e424530 100644 (file)
@@ -3,7 +3,7 @@
     {
       "key": "sonar.devcockpit.license.secured",
       "name": "Dev Cockpit",
-      "value": "T3JnYW5pc2F0aW9uOiBVbmtub3duIApTZXJ2ZXI6IDU0MzIxIApQcm9kdWN0OiBvdGhlciAKRXhwaXJhdGlvbjogMjAxMC0wMS0wMSAKVHlwZTogRVZBTFVBVElPTiAK",
+      "value": "ABCD",
       "product": "other",
       "organization": "Unknown",
       "expiration": "2010-01-01",
@@ -16,7 +16,7 @@
     {
       "key": "sonar.governance.license.secured",
       "name": "Governance",
-      "value": "T3JnYW5pc2F0aW9uOiBTb25hclNvdXJjZSAKU2VydmVyOiAxMjM0NSAKUHJvZHVjdDogZ292ZXJuYW5jZSAKRXhwaXJhdGlvbjogMjA5OS0wMS0wMSAKVHlwZTogUFJPRFVDVElPTiAKb3RoZXI6IHZhbHVlIAo\u003d",
+      "value": "EFHG",
       "product": "governance",
       "organization": "SonarSource",
       "expiration": "2099-01-01",
index d831532356dfe306f52386b33f462ef020c88100..e819d6ca02577cf4cc7ab93547cb23fd180b3e00 100644 (file)
@@ -42,7 +42,6 @@ import org.sonar.server.setting.ws.SettingsFinder;
 import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.JsonAssert;
 import org.sonarqube.ws.Licenses;
 import org.sonarqube.ws.Licenses.ListWsResponse;
 import org.sonarqube.ws.MediaTypes;
@@ -54,7 +53,6 @@ import static org.sonar.api.PropertyType.LICENSE;
 import static org.sonar.core.permission.GlobalPermissions.DASHBOARD_SHARING;
 import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
 import static org.sonar.db.property.PropertyTesting.newGlobalPropertyDto;
-import static org.sonarqube.ws.MediaTypes.JSON;
 
 public class ListActionTest {
 
@@ -270,22 +268,6 @@ public class ListActionTest {
     executeRequest();
   }
 
-  @Test
-  public void test_example_json_response() {
-    setUserAsSystemAdmin();
-    addServerIdSettings("12345");
-    addLicenseSetting("sonar.governance.license.secured", "Governance",
-      createBase64License("SonarSource", "governance", "12345", "2099-01-01", "PRODUCTION", ImmutableMap.of("other", "value")));
-    addLicenseSetting("sonar.devcockpit.license.secured", "Dev Cockpit", createBase64License("Unknown", "other", "54321", "2010-01-01", "EVALUATION", Collections.emptyMap()));
-
-    String result = ws.newRequest()
-      .setMediaType(JSON)
-      .execute()
-      .getInput();
-
-    JsonAssert.assertJson(ws.getDef().responseExampleAsString()).isSimilarTo(result);
-  }
-
   @Test
   public void test_ws_definition() {
     WebService.Action action = ws.getDef();