From 463f2a004f54afa7a3bad73c0c3468223d22af12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Wed, 2 Nov 2016 15:42:05 +0100 Subject: [PATCH] SONAR-8096 fix response leaking data from 1 org to the other --- .../sonar/server/organization/ws/OrganizationsWsSupport.java | 1 + .../org/sonar/server/organization/ws/example-search.json | 5 +---- .../org/sonar/server/organization/ws/SearchActionTest.java | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) 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); -- 2.39.5