use of org.sonarqube.ws.AlmIntegrations.SearchAzureReposWsResponse in project sonarqube by SonarSource.
the class SearchAzureReposActionTest method search_repos.
@Test
public void search_repos() {
AlmSettingDto almSetting = insertAlmSetting();
SearchAzureReposWsResponse response = ws.newRequest().setParam("almSetting", almSetting.getKey()).executeProtobuf(SearchAzureReposWsResponse.class);
assertThat(response.getRepositoriesList()).extracting(AzureRepo::getName, AzureRepo::getProjectName).containsExactlyInAnyOrder(tuple("repoName-1", "project-1"), tuple("repoName-2", "project-2"));
}
use of org.sonarqube.ws.AlmIntegrations.SearchAzureReposWsResponse in project sonarqube by SonarSource.
the class SearchAzureReposActionTest method search_repos_with_project_already_set_u_and_collision_is_handled.
@Test
public void search_repos_with_project_already_set_u_and_collision_is_handled() {
AlmSettingDto almSetting = insertAlmSetting();
ProjectDto projectDto2 = insertProject(almSetting, "repoName-2", "project-2");
insertProject(almSetting, "repoName-2", "project-2");
SearchAzureReposWsResponse response = ws.newRequest().setParam("almSetting", almSetting.getKey()).executeProtobuf(SearchAzureReposWsResponse.class);
assertThat(response.getRepositoriesCount()).isEqualTo(2);
assertThat(response.getRepositoriesList()).extracting(AzureRepo::getName, AzureRepo::getProjectName, AzureRepo::getSqProjectKey, AzureRepo::getSqProjectName).containsExactlyInAnyOrder(tuple("repoName-1", "project-1", "", ""), tuple("repoName-2", "project-2", projectDto2.getKey(), projectDto2.getName()));
}
use of org.sonarqube.ws.AlmIntegrations.SearchAzureReposWsResponse in project sonarqube by SonarSource.
the class SearchAzureReposActionTest method search_repos_with_project_name_and_empty_criteria.
@Test
public void search_repos_with_project_name_and_empty_criteria() {
AlmSettingDto almSetting = insertAlmSetting();
SearchAzureReposWsResponse response = ws.newRequest().setParam("almSetting", almSetting.getKey()).setParam("projectName", "project-1").setParam("searchQuery", "").executeProtobuf(SearchAzureReposWsResponse.class);
assertThat(response.getRepositoriesList()).extracting(AzureRepo::getName, AzureRepo::getProjectName).containsExactlyInAnyOrder(tuple("repoName-1", "project-1"), tuple("repoName-2", "project-2"));
}
Aggregations