use of org.sonarqube.ws.Ce.ActivityResponse in project sonarqube by SonarSource.
the class ActivityActionTest method assertPage.
private void assertPage(int page, int pageSize, List<String> expectedOrderedTaskIds) {
ActivityResponse activityResponse = call(ws.newRequest().setParam(Param.PAGE, Integer.toString(page)).setParam(Param.PAGE_SIZE, Integer.toString(pageSize)).setParam(PARAM_STATUS, "SUCCESS,FAILED,CANCELED,IN_PROGRESS,PENDING"));
assertThat(activityResponse.getPaging().getPageIndex()).isEqualTo(page);
assertThat(activityResponse.getPaging().getPageSize()).isEqualTo(pageSize);
assertThat(activityResponse.getTasksCount()).isEqualTo(expectedOrderedTaskIds.size());
for (int i = 0; i < expectedOrderedTaskIds.size(); i++) {
String expectedTaskId = expectedOrderedTaskIds.get(i);
assertThat(activityResponse.getTasks(i).getId()).isEqualTo(expectedTaskId);
}
}
use of org.sonarqube.ws.Ce.ActivityResponse in project sonarqube by SonarSource.
the class ActivityActionTest method task_without_project.
@Test
public void task_without_project() {
logInAsSystemAdministrator();
insertQueue("T3", null, PENDING);
ActivityResponse activityResponse = call(ws.newRequest().setParam("status", "PENDING"));
assertThat(activityResponse.getTasksList()).hasSize(1);
}
use of org.sonarqube.ws.Ce.ActivityResponse in project sonarqube by SonarSource.
the class ActivityActionTest method remove_queued_already_completed.
@Test
public void remove_queued_already_completed() {
logInAsSystemAdministrator();
ComponentDto project1 = db.components().insertPrivateProject();
insertActivity("T1", project1, SUCCESS);
insertQueue("T1", project1, IN_PROGRESS);
ActivityResponse activityResponse = call(ws.newRequest().setParam(Param.PAGE_SIZE, Integer.toString(10)).setParam(PARAM_STATUS, "SUCCESS,FAILED,CANCELED,IN_PROGRESS,PENDING"));
assertThat(activityResponse.getTasksList()).extracting(Task::getId, Ce.Task::getStatus).containsExactlyInAnyOrder(tuple("T1", Ce.TaskStatus.SUCCESS));
}
Aggregations