use of org.sonarqube.ws.AlmSettings.CountBindingWsResponse in project sonarqube by SonarSource.
the class CountBindingAction method handle.
@Override
public void handle(Request request, Response response) throws Exception {
userSession.checkIsSystemAdministrator();
CountBindingWsResponse wsResponse = doHandle(request);
writeProtobuf(wsResponse, request, response);
}
use of org.sonarqube.ws.AlmSettings.CountBindingWsResponse in project sonarqube by SonarSource.
the class CountBindingActionTest method count_github_binding.
@Test
public void count_github_binding() {
UserDto user = db.users().insertUser();
userSession.logIn(user).setSystemAdministrator();
AlmSettingDto almSetting = db.almSettings().insertGitHubAlmSetting();
ProjectDto project1 = db.components().insertPrivateProjectDto();
ProjectDto project2 = db.components().insertPrivateProjectDto();
db.almSettings().insertGitHubProjectAlmSetting(almSetting, project1);
db.almSettings().insertGitHubProjectAlmSetting(almSetting, project2);
CountBindingWsResponse response = ws.newRequest().setParam("almSetting", almSetting.getKey()).executeProtobuf(CountBindingWsResponse.class);
assertThat(response.getKey()).isEqualTo(almSetting.getKey());
assertThat(response.getProjects()).isEqualTo(2);
}
use of org.sonarqube.ws.AlmSettings.CountBindingWsResponse in project sonarqube by SonarSource.
the class CountBindingActionTest method count_azure_binding.
@Test
public void count_azure_binding() {
UserDto user = db.users().insertUser();
userSession.logIn(user).setSystemAdministrator();
AlmSettingDto almSetting = db.almSettings().insertAzureAlmSetting();
ProjectDto project1 = db.components().insertPrivateProjectDto();
db.almSettings().insertAzureProjectAlmSetting(almSetting, project1);
CountBindingWsResponse response = ws.newRequest().setParam("almSetting", almSetting.getKey()).executeProtobuf(CountBindingWsResponse.class);
assertThat(response.getKey()).isEqualTo(almSetting.getKey());
assertThat(response.getProjects()).isOne();
}
Aggregations