aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/test
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-03-17 17:14:45 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-03-21 13:05:50 +0100
commit5acc864451b7a727c55697093fbf0439af6994bf (patch)
tree4a63fa16ae21c5a73dd181e5fcc1ec1f4fd435fc /sonar-ws/src/test
parent14cbaf7f117d8e6fac992459a4e32089b1a81fbe (diff)
downloadsonarqube-5acc864451b7a727c55697093fbf0439af6994bf.tar.gz
sonarqube-5acc864451b7a727c55697093fbf0439af6994bf.zip
SONAR-8968 Add organization parameter in api/users/groups
Diffstat (limited to 'sonar-ws/src/test')
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/user/GroupsRequestTest.java11
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java3
2 files changed, 10 insertions, 4 deletions
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/user/GroupsRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/user/GroupsRequestTest.java
index 082e5f720b6..58270e89608 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/user/GroupsRequestTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/user/GroupsRequestTest.java
@@ -37,6 +37,7 @@ public class GroupsRequestTest {
public void create_request() {
GroupsRequest result = underTest
.setLogin("john")
+ .setOrganization("orga-uuid")
.setSelected("all")
.setQuery("sonar-users")
.setPage(10)
@@ -44,6 +45,7 @@ public class GroupsRequestTest {
.build();
assertThat(result.getLogin()).isEqualTo("john");
+ assertThat(result.getOrganization()).isEqualTo("orga-uuid");
assertThat(result.getSelected()).isEqualTo("all");
assertThat(result.getQuery()).isEqualTo("sonar-users");
assertThat(result.getPage()).isEqualTo(10);
@@ -52,9 +54,12 @@ public class GroupsRequestTest {
@Test
public void create_request_wih_minimal_fields() {
- GroupsRequest result = underTest.setLogin("john").build();
+ GroupsRequest result = underTest
+ .setLogin("john")
+ .build();
assertThat(result.getLogin()).isEqualTo("john");
+ assertThat(result.getOrganization()).isNull();
assertThat(result.getSelected()).isNull();
assertThat(result.getQuery()).isNull();
assertThat(result.getPage()).isNull();
@@ -66,9 +71,7 @@ public class GroupsRequestTest {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Login is mandatory and must not be empty");
- underTest
- .setLogin("")
- .build();
+ underTest.setLogin("").build();
}
@Test
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java
index 37902de632c..c92f7619ffe 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java
@@ -36,6 +36,7 @@ import static org.sonarqube.ws.client.user.UsersWsParameters.PARAM_EMAIL;
import static org.sonarqube.ws.client.user.UsersWsParameters.PARAM_LOCAL;
import static org.sonarqube.ws.client.user.UsersWsParameters.PARAM_LOGIN;
import static org.sonarqube.ws.client.user.UsersWsParameters.PARAM_NAME;
+import static org.sonarqube.ws.client.user.UsersWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.user.UsersWsParameters.PARAM_PASSWORD;
import static org.sonarqube.ws.client.user.UsersWsParameters.PARAM_SCM_ACCOUNT;
import static org.sonarqube.ws.client.user.UsersWsParameters.PARAM_SELECTED;
@@ -90,6 +91,7 @@ public class UsersServiceTest {
public void groups() {
underTest.groups(GroupsRequest.builder()
.setLogin("john")
+ .setOrganization("orga-uuid")
.setSelected("all")
.setQuery("sonar-users")
.setPage(10)
@@ -99,6 +101,7 @@ public class UsersServiceTest {
assertThat(serviceTester.getGetParser()).isSameAs(GroupsWsResponse.parser());
serviceTester.assertThat(serviceTester.getGetRequest())
.hasParam(PARAM_LOGIN, "john")
+ .hasParam(PARAM_ORGANIZATION, "orga-uuid")
.hasParam(PARAM_SELECTED, "all")
.hasParam(TEXT_QUERY, "sonar-users")
.hasParam(PAGE, 10)