Search in sources :

Example 6 with GetBindingWsResponse

use of org.sonarqube.ws.AlmSettings.GetBindingWsResponse in project sonarqube by SonarSource.

the class GetBindingActionTest method get_bitbucket_project_binding.

@Test
public void get_bitbucket_project_binding() {
    userSession.logIn(user).addProjectPermission(ADMIN, project);
    AlmSettingDto almSetting = db.almSettings().insertBitbucketAlmSetting();
    ProjectAlmSettingDto projectAlmSettingDto = db.almSettings().insertBitbucketProjectAlmSetting(almSetting, project);
    GetBindingWsResponse response = ws.newRequest().setParam("project", project.getKey()).executeProtobuf(GetBindingWsResponse.class);
    assertThat(response.getAlm()).isEqualTo(AlmSettings.Alm.bitbucket);
    assertThat(response.getKey()).isEqualTo(almSetting.getKey());
    assertThat(response.getRepository()).isEqualTo(projectAlmSettingDto.getAlmRepo());
    assertThat(response.getUrl()).isEqualTo(almSetting.getUrl());
    assertThat(response.getSlug()).isEqualTo(projectAlmSettingDto.getAlmSlug());
    assertThat(response.hasSummaryCommentEnabled()).isFalse();
}
Also used : ProjectAlmSettingDto(org.sonar.db.alm.setting.ProjectAlmSettingDto) GetBindingWsResponse(org.sonarqube.ws.AlmSettings.GetBindingWsResponse) AlmSettingDto(org.sonar.db.alm.setting.AlmSettingDto) ProjectAlmSettingDto(org.sonar.db.alm.setting.ProjectAlmSettingDto) Test(org.junit.Test)

Aggregations

GetBindingWsResponse (org.sonarqube.ws.AlmSettings.GetBindingWsResponse)6 AlmSettingDto (org.sonar.db.alm.setting.AlmSettingDto)5 ProjectAlmSettingDto (org.sonar.db.alm.setting.ProjectAlmSettingDto)5 Test (org.junit.Test)4 ProjectDto (org.sonar.db.project.ProjectDto)2 DbSession (org.sonar.db.DbSession)1 UserDto (org.sonar.db.user.UserDto)1 NotFoundException (org.sonar.server.exceptions.NotFoundException)1