Search in sources :

Example 1 with MetricType

use of org.sonar.ce.task.projectanalysis.metric.Metric.MetricType in project sonarqube by SonarSource.

the class ConditionEvaluatorTest method condition_is_always_ok_when_measure_is_noValue.

@Test
public void condition_is_always_ok_when_measure_is_noValue() {
    for (MetricType metricType : from(asList(values())).filter(not(in(ImmutableSet.of(BOOL, DATA, DISTRIB, STRING))))) {
        Metric metric = createMetric(metricType);
        Measure measure = newMeasureBuilder().createNoValue();
        assertThat(underTest.evaluate(createCondition(metric, LESS_THAN, "10.2"), measure)).hasLevel(OK);
    }
}
Also used : MetricType(org.sonar.ce.task.projectanalysis.metric.Metric.MetricType) Measure(org.sonar.ce.task.projectanalysis.measure.Measure) Metric(org.sonar.ce.task.projectanalysis.metric.Metric) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Measure (org.sonar.ce.task.projectanalysis.measure.Measure)1 Metric (org.sonar.ce.task.projectanalysis.metric.Metric)1 MetricType (org.sonar.ce.task.projectanalysis.metric.Metric.MetricType)1