use of org.sonarqube.ws.WsComponents.TreeWsResponse in project sonarqube by SonarSource.
the class TreeActionTest method sort_descendants_by_qualifier.
@Test
public void sort_descendants_by_qualifier() throws IOException {
ComponentDto project = newProjectDto(db.organizations().insert(), "project-uuid");
componentDb.insertProjectAndSnapshot(project);
componentDb.insertComponent(newFileDto(project, 1));
componentDb.insertComponent(newFileDto(project, 2));
ComponentDto module = newModuleDto("module-uuid-1", project);
componentDb.insertComponent(module);
componentDb.insertComponent(newDirectory(project, "path/directory/", "directory-uuid-1"));
db.commit();
logInWithBrowsePermission(project);
TreeWsResponse response = call(ws.newRequest().setParam(PARAM_STRATEGY, "all").setParam(Param.SORT, "qualifier, name").setParam(PARAM_COMPONENT_ID, "project-uuid"));
assertThat(response.getComponentsList()).extracting("id").containsExactly("module-uuid-1", "path/directory/", "file-uuid-1", "file-uuid-2");
}
Aggregations