]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8096 fix response leaking data from 1 org to the other 1350/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 2 Nov 2016 14:42:05 +0000 (15:42 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 3 Nov 2016 11:16:41 +0000 (12:16 +0100)
server/sonar-server/src/main/java/org/sonar/server/organization/ws/OrganizationsWsSupport.java
server/sonar-server/src/main/resources/org/sonar/server/organization/ws/example-search.json
server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchActionTest.java

index 1f87799523ace812a85ba20717cc8dd84f28f5f1..38b3a96d71907c4ccca615490d64d87cfdbdd905 100644 (file)
@@ -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) {
index 4d26e0082288fd3407a12bdc71483c2c536eb2fc..ef0b9d84d24aa3e68d442b6299d16789c9c2fc69 100644 (file)
@@ -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",
index be36067a7b329173db49b6ed3e92d70b79f2d35d..af2d28fe381e2088319cc0bf585ae3eb0d56d67c 100644 (file)
@@ -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);