use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class UiTest method footer_contains_version.
@Test
public void footer_contains_version() {
WsResponse status = ItUtils.newAdminWsClient(ORCHESTRATOR).wsConnector().call(new GetRequest("api/navigation/global"));
Map<String, Object> statusMap = ItUtils.jsonToMap(status.content());
nav.getFooter().should(hasText((String) statusMap.get("version")));
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class ServerSystemRestartingOrchestrator method support_install_dir_with_whitespaces.
@Test
public void support_install_dir_with_whitespaces() throws Exception {
String dirName = "target/has space";
FileUtils.deleteDirectory(new File(dirName));
orchestrator = Orchestrator.builderEnv().setOrchestratorProperty("orchestrator.workspaceDir", dirName).build();
orchestrator.start();
WsResponse statusResponse = newWsClient(orchestrator).wsConnector().call(new GetRequest("api/system/status"));
Map<String, Object> json = ItUtils.jsonToMap(statusResponse.content());
assertThat(json.get("status")).isEqualTo("UP");
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class ServerSystemTest method getValidIpAddress.
private String getValidIpAddress() throws IOException {
WsClient adminWsClient = newAdminWsClient(orchestrator);
ShowWsResponse response = ShowWsResponse.parseFrom(adminWsClient.wsConnector().call(new GetRequest("api/server_id/show").setMediaType(MediaTypes.PROTOBUF)).contentStream());
assertThat(response.getValidIpAddressesCount()).isGreaterThan(0);
return response.getValidIpAddresses(0);
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class WsLocalCallTest method fails_if_requires_permissions.
@Test
public void fails_if_requires_permissions() {
WsResponse response = newWsClient(orchestrator).wsConnector().call(new GetRequest("local_ws_call/require_permission"));
// this is not the unauthorized code as plugin forces it to 500
assertThat(response.code()).isEqualTo(500);
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class WsLocalCallTest method gets_json.
@Test
public void gets_json() {
WsResponse response = newWsClient(orchestrator).wsConnector().call(new GetRequest("local_ws_call/json_data"));
assertThat(response.isSuccessful()).isTrue();
}
Aggregations