Search in sources :

Example 6 with GetByProjectWsResponse

use of org.sonarqube.ws.WsQualityGates.GetByProjectWsResponse in project sonarqube by SonarSource.

the class GetByProjectActionTest method get_with_project_user_permission.

@Test
public void get_with_project_user_permission() {
    ComponentDto project = componentDb.insertProject();
    userSession.logIn().addProjectUuidPermissions(UserRole.USER, project.uuid());
    QualityGateDto dbQualityGate = insertQualityGate("Sonar way");
    setDefaultQualityGate(dbQualityGate.getId());
    GetByProjectWsResponse result = callByUuid(project.uuid());
    assertThat(result.getQualityGate().getName()).isEqualTo(dbQualityGate.getName());
}
Also used : ComponentDto(org.sonar.db.component.ComponentDto) GetByProjectWsResponse(org.sonarqube.ws.WsQualityGates.GetByProjectWsResponse) QualityGateDto(org.sonar.db.qualitygate.QualityGateDto) Test(org.junit.Test)

Aggregations

QualityGateDto (org.sonar.db.qualitygate.QualityGateDto)6 GetByProjectWsResponse (org.sonarqube.ws.WsQualityGates.GetByProjectWsResponse)6 Test (org.junit.Test)5 ComponentDto (org.sonar.db.component.ComponentDto)5 WsQualityGates (org.sonarqube.ws.WsQualityGates)2