Search in sources :

Example 1 with GsonAzureProject

use of org.sonar.alm.client.azure.GsonAzureProject in project sonarqube by SonarSource.

the class ListAzureProjectsActionTest method list_projects_alphabetically_sorted.

@Test
public void list_projects_alphabetically_sorted() {
    mockClient(ImmutableList.of(new GsonAzureProject("BBB project", "BBB project description"), new GsonAzureProject("AAA project 1", "AAA project description"), new GsonAzureProject("zzz project", "zzz project description"), new GsonAzureProject("aaa project", "aaa project description")));
    AlmSettingDto almSetting = insertAlmSetting();
    ListAzureProjectsWsResponse response = ws.newRequest().setParam("almSetting", almSetting.getKey()).executeProtobuf(ListAzureProjectsWsResponse.class);
    assertThat(response.getProjectsCount()).isEqualTo(4);
    assertThat(response.getProjectsList()).extracting(AzureProject::getName, AzureProject::getDescription).containsExactly(tuple("aaa project", "aaa project description"), tuple("AAA project 1", "AAA project description"), tuple("BBB project", "BBB project description"), tuple("zzz project", "zzz project description"));
}
Also used : ListAzureProjectsWsResponse(org.sonarqube.ws.AlmIntegrations.ListAzureProjectsWsResponse) GsonAzureProject(org.sonar.alm.client.azure.GsonAzureProject) AlmSettingDto(org.sonar.db.alm.setting.AlmSettingDto) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 GsonAzureProject (org.sonar.alm.client.azure.GsonAzureProject)1 AlmSettingDto (org.sonar.db.alm.setting.AlmSettingDto)1 ListAzureProjectsWsResponse (org.sonarqube.ws.AlmIntegrations.ListAzureProjectsWsResponse)1