aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/test
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-11-17 12:05:00 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-11-17 13:41:34 +0100
commit08d3297f4a786d1763f7f6475561307339fe6985 (patch)
tree099b5e0527191b5dbd5eba3ebba745524bea1fdd /sonar-ws/src/test
parent1da240b65309492730876b70e91dc081e22a7cb2 (diff)
downloadsonarqube-08d3297f4a786d1763f7f6475561307339fe6985.tar.gz
sonarqube-08d3297f4a786d1763f7f6475561307339fe6985.zip
SONAR-6947 Add tests and bug fixes
Diffstat (limited to 'sonar-ws/src/test')
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/WsClientTest.java34
1 files changed, 0 insertions, 34 deletions
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/WsClientTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/WsClientTest.java
index a3bdf4967f6..13ff1fa14f3 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/WsClientTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/WsClientTest.java
@@ -23,21 +23,17 @@ package org.sonarqube.ws.client;
import com.google.common.net.HttpHeaders;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsComponents;
-import org.sonarqube.ws.WsPermissions.WsGroupsResponse;
-import org.sonarqube.ws.client.permission.GroupsWsRequest;
import static java.net.HttpURLConnection.HTTP_OK;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonarqube.ws.client.HttpConnector.newDefaultHttpConnector;
import static org.sonarqube.ws.client.HttpConnector.newHttpConnector;
import static org.sonarqube.ws.client.WsRequest.newGetRequest;
-import static org.sonarqube.ws.client.WsRequest.newPostRequest;
public class WsClientTest {
@Rule
@@ -152,34 +148,4 @@ public class WsClientTest {
assertThat(requestFactory.getProxyLogin()).isEqualTo("proxyLogin");
assertThat(requestFactory.getProxyPassword()).isEqualTo("proxyPass");
}
-
- @Ignore
- @Test
- public void contact_localhost() {
- /**
- * This is a temporary test to have a simple end-to-end test
- * To make it work launch a default sonar server locally
- */
- WsClient ws = new WsClient(newHttpConnector()
- .url("http://localhost:9000")
- .login("admin")
- .password("admin")
- .build());
-
- // test with json response
- String stringResponse = ws.execute(newGetRequest("api/webservices/list"));
- assertThat(stringResponse).contains("webservices", "permissions");
-
- // test with protobuf response
- WsGroupsResponse protobufResponse = ws.execute(newPostRequest("api/permissions/groups")
- .setMediaType(WsRequest.MediaType.PROTOBUF)
- .setParam("permission", "admin"),
- WsGroupsResponse.parser());
- assertThat(protobufResponse.getGroups(0).getName()).contains("sonar-administrator");
-
- // test with specific client
- WsGroupsResponse groupsResponse = ws.permissionsClient().groups(new GroupsWsRequest()
- .setPermission("admin"));
- assertThat(groupsResponse.getGroups(0).getName()).contains("sonar-administrator");
- }
}