From: Julien Lancelot Date: Fri, 9 Sep 2016 09:38:29 +0000 (+0200) Subject: SONAR-8039 Do not return valid hash in example X-Git-Tag: 6.1-RC1~154 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0d82614df0e930a71daba20612a4091c08a6e614;p=sonarqube.git SONAR-8039 Do not return valid hash in example --- diff --git a/server/sonar-server/src/main/resources/org/sonar/server/license/ws/list-example.json b/server/sonar-server/src/main/resources/org/sonar/server/license/ws/list-example.json index 62a99ef1e53..f8a7526000d 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/license/ws/list-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/license/ws/list-example.json @@ -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", diff --git a/server/sonar-server/src/test/java/org/sonar/server/license/ws/ListActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/license/ws/ListActionTest.java index d831532356d..e819d6ca025 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/license/ws/ListActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/license/ws/ListActionTest.java @@ -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();