From: Sébastien Lesaint Date: Wed, 2 Nov 2016 14:42:05 +0000 (+0100) Subject: SONAR-8096 fix response leaking data from 1 org to the other X-Git-Tag: 6.2-RC1~225 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=463f2a004f54afa7a3bad73c0c3468223d22af12;p=sonarqube.git SONAR-8096 fix response leaking data from 1 org to the other --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/organization/ws/OrganizationsWsSupport.java b/server/sonar-server/src/main/java/org/sonar/server/organization/ws/OrganizationsWsSupport.java index 1f87799523a..38b3a96d719 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/organization/ws/OrganizationsWsSupport.java +++ b/server/sonar-server/src/main/java/org/sonar/server/organization/ws/OrganizationsWsSupport.java @@ -103,6 +103,7 @@ public class OrganizationsWsSupport { Organizations.Organization toOrganization(Organizations.Organization.Builder builder, OrganizationDto dto) { builder + .clear() .setName(dto.getName()) .setKey(dto.getKey()); if (dto.getDescription() != null) { diff --git a/server/sonar-server/src/main/resources/org/sonar/server/organization/ws/example-search.json b/server/sonar-server/src/main/resources/org/sonar/server/organization/ws/example-search.json index 4d26e008228..ef0b9d84d24 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/organization/ws/example-search.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/organization/ws/example-search.json @@ -2,10 +2,7 @@ "organizations": [ { "key": "foo-company", - "name": "Foo Company", - "description": "The Foo company produces quality software.", - "url": "https://www.foo.com", - "avatar": "https://www.foo.com/foo.png" + "name": "Foo Company" }, { "key": "bar-company", diff --git a/server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchActionTest.java index be36067a7b3..af2d28fe381 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchActionTest.java @@ -102,10 +102,7 @@ public class SearchActionTest { insertOrganization(new OrganizationDto() .setUuid(Uuids.UUID_EXAMPLE_01) .setKey("foo-company") - .setName("Foo Company") - .setDescription("The Foo company produces quality software.") - .setUrl("https://www.foo.com") - .setAvatarUrl("https://www.foo.com/foo.png")); + .setName("Foo Company")); String response = executeJsonRequest(null, null);