aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-11-02 15:42:05 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-11-03 12:16:41 +0100
commit463f2a004f54afa7a3bad73c0c3468223d22af12 (patch)
treed41b97c27424979b40b2831aaf4fd7a4f2a09cc5 /server
parent8a806eaa8871b70543c6846a1220bd63d7854495 (diff)
downloadsonarqube-463f2a004f54afa7a3bad73c0c3468223d22af12.tar.gz
sonarqube-463f2a004f54afa7a3bad73c0c3468223d22af12.zip
SONAR-8096 fix response leaking data from 1 org to the other
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/organization/ws/OrganizationsWsSupport.java1
-rw-r--r--server/sonar-server/src/main/resources/org/sonar/server/organization/ws/example-search.json5
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchActionTest.java5
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);