use of org.sonarqube.ws.Measures.SearchWsResponse in project sonarqube by SonarSource.
the class SearchActionTest method does_not_return_branch_when_using_db_key.
@Test
public void does_not_return_branch_when_using_db_key() {
MetricDto coverage = db.measures().insertMetric(m -> m.setValueType(FLOAT.name()));
ComponentDto project = db.components().insertPrivateProject();
ComponentDto branch = db.components().insertProjectBranch(project);
db.measures().insertLiveMeasure(branch, coverage, m -> m.setValue(10d));
userSession.addProjectPermission(UserRole.USER, project);
SearchWsResponse result = call(singletonList(branch.getDbKey()), singletonList(coverage.getKey()));
assertThat(result.getMeasuresList()).isEmpty();
}
Aggregations