aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-03-16 14:15:27 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-03-21 13:05:50 +0100
commitadb4e4dfcea1a219c16837e1b4fce0695d092d7d (patch)
treef94a5eb3d08469994886ebb3ae1cd324a1288cff /sonar-ws
parent500d6ef8c155111231d2cc3711e8cf659fedb92a (diff)
downloadsonarqube-adb4e4dfcea1a219c16837e1b4fce0695d092d7d.tar.gz
sonarqube-adb4e4dfcea1a219c16837e1b4fce0695d092d7d.zip
SONAR-8893 Add remove member action in ws client
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java8
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java11
2 files changed, 19 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java
index 408909067cf..441bee64831 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java
@@ -80,4 +80,12 @@ public class OrganizationService extends BaseService {
call(post);
}
+
+ public void removeMember(String organizationKey, String login) {
+ PostRequest post = new PostRequest(path("remove_member"))
+ .setParam("organization", requireNonNull(organizationKey))
+ .setParam("login", requireNonNull(login));
+
+ call(post);
+ }
}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java
index c8ed2429e4d..d8bb4140bdb 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java
@@ -44,4 +44,15 @@ public class OrganizationServiceTest {
.hasParam("login", "login-1")
.andNoOtherParam();
}
+
+ @Test
+ public void remove_member() {
+ underTest.removeMember("O1", "login-1");
+
+ serviceTester.assertThat(serviceTester.getPostRequest())
+ .hasPath("remove_member")
+ .hasParam("organization", "O1")
+ .hasParam("login", "login-1")
+ .andNoOtherParam();
+ }
}