Search in sources :

Example 11 with ProjectAlmSettingDto

use of org.sonar.db.alm.setting.ProjectAlmSettingDto 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

ProjectAlmSettingDto (org.sonar.db.alm.setting.ProjectAlmSettingDto)11 AlmSettingDto (org.sonar.db.alm.setting.AlmSettingDto)7 Test (org.junit.Test)5 ProjectDto (org.sonar.db.project.ProjectDto)4 GetBindingWsResponse (org.sonarqube.ws.AlmSettings.GetBindingWsResponse)4 DbSession (org.sonar.db.DbSession)2 BranchDto (org.sonar.db.component.BranchDto)2 UserDto (org.sonar.db.user.UserDto)2 NotFoundException (org.sonar.server.exceptions.NotFoundException)2 Projects (org.sonarqube.ws.Projects)2 GsonAzureRepo (org.sonar.alm.client.azure.GsonAzureRepo)1 Repository (org.sonar.alm.client.bitbucket.bitbucketcloud.Repository)1 GithubApplicationClient (org.sonar.alm.client.github.GithubApplicationClient)1 Repository (org.sonar.alm.client.github.GithubApplicationClient.Repository)1 AccessToken (org.sonar.alm.client.github.security.AccessToken)1 UserAccessToken (org.sonar.alm.client.github.security.UserAccessToken)1 AlmPatDto (org.sonar.db.alm.pat.AlmPatDto)1