use of org.sonarqube.ws.WsMeasures.SearchWsResponse in project sonarqube by SonarSource.
the class SearchActionTest method do_not_verify_permissions_if_user_is_root.
@Test
public void do_not_verify_permissions_if_user_is_root() {
MetricDto metricDto = insertComplexityMetric();
ComponentDto project1 = newProjectDto(db.getDefaultOrganization());
SnapshotDto projectSnapshot1 = db.components().insertProjectAndSnapshot(project1);
dbClient.measureDao().insert(dbSession, newMeasureDto(metricDto, project1, projectSnapshot1).setValue(15.5d));
db.commit();
userSession.setNonRoot();
SearchWsResponse result = call(asList(project1.key()), singletonList("complexity"));
assertThat(result.getMeasuresCount()).isEqualTo(0);
userSession.setRoot();
result = call(asList(project1.key()), singletonList("complexity"));
assertThat(result.getMeasuresCount()).isEqualTo(1);
}
Aggregations