use of org.sonar.server.measure.index.ProjectMeasuresQuery in project sonarqube by SonarSource.
the class ProjectMeasuresQueryFactoryTest method filter_on_projectUuids_if_projectUuid_is_empty_and_criteria_is_empty.
@Test
public void filter_on_projectUuids_if_projectUuid_is_empty_and_criteria_is_empty() throws Exception {
ProjectMeasuresQuery query = newProjectMeasuresQuery(emptyList(), emptySet());
assertThat(query.getProjectUuids()).isPresent();
}
use of org.sonar.server.measure.index.ProjectMeasuresQuery in project sonarqube by SonarSource.
the class ProjectMeasuresQueryFactoryTest method create_query_on_language_using_in_operator.
@Test
public void create_query_on_language_using_in_operator() throws Exception {
ProjectMeasuresQuery query = newProjectMeasuresQuery(singletonList(Criterion.builder().setKey("languages").setOperator(IN).setValues(asList("java", "js")).build()), emptySet());
assertThat(query.getLanguages().get()).containsOnly("java", "js");
}
use of org.sonar.server.measure.index.ProjectMeasuresQuery in project sonarqube by SonarSource.
the class ProjectMeasuresQueryFactoryTest method filter_on_projectUuids_if_projectUuid_is_non_empty_and_criteria_empty.
@Test
public void filter_on_projectUuids_if_projectUuid_is_non_empty_and_criteria_empty() throws Exception {
ProjectMeasuresQuery query = newProjectMeasuresQuery(emptyList(), Collections.singleton("foo"));
assertThat(query.getProjectUuids()).isPresent();
}
use of org.sonar.server.measure.index.ProjectMeasuresQuery in project sonarqube by SonarSource.
the class ProjectMeasuresQueryFactoryTest method filter_on_projectUuids_if_projectUuid_is_empty_and_criteria_non_empty.
@Test
public void filter_on_projectUuids_if_projectUuid_is_empty_and_criteria_non_empty() throws Exception {
ProjectMeasuresQuery query = newProjectMeasuresQuery(singletonList(Criterion.builder().setKey("ncloc").setOperator(GT).setValue("10").build()), emptySet());
assertThat(query.getProjectUuids()).isPresent();
}
use of org.sonar.server.measure.index.ProjectMeasuresQuery in project sonarqube by SonarSource.
the class ProjectMeasuresQueryFactoryTest method accept_empty_query.
@Test
public void accept_empty_query() throws Exception {
ProjectMeasuresQuery result = newProjectMeasuresQuery(emptyList(), emptySet());
assertThat(result.getMetricCriteria()).isEmpty();
}
Aggregations