use of org.sonarqube.ws.WsCe.ActivityResponse in project sonarqube by SonarSource.
the class ActivityActionTest method search_task_by_component_id.
@Test
public void search_task_by_component_id() {
ComponentDto project = dbTester.components().insertProject(dbTester.getDefaultOrganization(), "PROJECT_1");
insertQueue("T1", "PROJECT_1", CeQueueDto.Status.IN_PROGRESS);
insertActivity("T1", "PROJECT_1", CeActivityDto.Status.SUCCESS);
userSession.logIn().addProjectUuidPermissions(UserRole.ADMIN, project.uuid());
ActivityResponse result = call(ws.newRequest().setParam(PARAM_COMPONENT_ID, "PROJECT_1").setParam(PARAM_TYPE, CeTaskTypes.REPORT).setParam(PARAM_STATUS, "SUCCESS,FAILED,CANCELED,IN_PROGRESS,PENDING"));
assertThat(result.getTasksCount()).isEqualTo(2);
}
use of org.sonarqube.ws.WsCe.ActivityResponse in project sonarqube by SonarSource.
the class ActivityActionTest method search_activity_by_component_name.
@Test
public void search_activity_by_component_name() throws IOException {
OrganizationDto organizationDto = dbTester.organizations().insert();
ComponentDto struts = newProjectDto(organizationDto).setName("old apache struts").setUuid("P1").setProjectUuid("P1");
ComponentDto zookeeper = newProjectDto(organizationDto).setName("new apache zookeeper").setUuid("P2").setProjectUuid("P2");
ComponentDto eclipse = newProjectDto(organizationDto).setName("eclipse").setUuid("P3").setProjectUuid("P3");
dbTester.components().insertProjectAndSnapshot(struts);
dbTester.components().insertProjectAndSnapshot(zookeeper);
dbTester.components().insertProjectAndSnapshot(eclipse);
logInAsSystemAdministrator();
insertActivity("T1", "P1", CeActivityDto.Status.SUCCESS);
insertActivity("T2", "P2", CeActivityDto.Status.SUCCESS);
insertActivity("T3", "P3", CeActivityDto.Status.SUCCESS);
ActivityResponse activityResponse = call(ws.newRequest().setParam(PARAM_COMPONENT_QUERY, "apac"));
assertThat(activityResponse.getTasksList()).extracting("id").containsOnly("T1", "T2");
}
use of org.sonarqube.ws.WsCe.ActivityResponse in project sonarqube by SonarSource.
the class ActivityActionTest method search_task_id_in_activity.
@Test
public void search_task_id_in_activity() {
logInAsSystemAdministrator();
dbTester.components().insertProject(dbTester.getDefaultOrganization(), "PROJECT_1");
insertActivity("T1", "PROJECT_1", CeActivityDto.Status.SUCCESS);
ActivityResponse result = call(ws.newRequest().setParam(Param.TEXT_QUERY, "T1"));
assertThat(result.getTasksCount()).isEqualTo(1);
assertThat(result.getTasks(0).getId()).isEqualTo("T1");
}
Aggregations