aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/test
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2017-03-09 18:00:16 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-03-21 13:05:50 +0100
commit1f81562e618e878377939c20a412e0ba796a54e3 (patch)
treea10a4c7b739e18fbe656081404e04495268aa036 /sonar-ws/src/test
parent25a9f85391d0391d84402f620e25c19f25769474 (diff)
downloadsonarqube-1f81562e618e878377939c20a412e0ba796a54e3.tar.gz
sonarqube-1f81562e618e878377939c20a412e0ba796a54e3.zip
SONAR-8892 Add WS api/organizations/add_member to WS client
Diffstat (limited to 'sonar-ws/src/test')
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java47
1 files changed, 47 insertions, 0 deletions
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
new file mode 100644
index 00000000000..c8ed2429e4d
--- /dev/null
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java
@@ -0,0 +1,47 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.sonarqube.ws.client.organization;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.sonarqube.ws.client.ServiceTester;
+import org.sonarqube.ws.client.WsConnector;
+
+import static org.mockito.Mockito.mock;
+
+public class OrganizationServiceTest {
+
+ @Rule
+ public ServiceTester<OrganizationService> serviceTester = new ServiceTester<>(new OrganizationService(mock(WsConnector.class)));
+
+ private OrganizationService underTest = serviceTester.getInstanceUnderTest();
+
+ @Test
+ public void add_member() {
+ underTest.addMember("O1", "login-1");
+
+ serviceTester.assertThat(serviceTester.getPostRequest())
+ .hasPath("add_member")
+ .hasParam("organization", "O1")
+ .hasParam("login", "login-1")
+ .andNoOtherParam();
+ }
+}