verify(conditionDao, times(conditions.size())).insert(any(QualityGateConditionDto.class), eq(session));
}
@Test
public void should_list_gate_metrics() {
Metric dataMetric = mock(Metric.class);
when(dataMetric.isDataType()).thenReturn(true);
Metric hiddenMetric = mock(Metric.class);
when(hiddenMetric.isHidden()).thenReturn(true);
Metric nullHiddenMetric = mock(Metric.class);
when(nullHiddenMetric.isHidden()).thenReturn(null);
Metric alertMetric = CoreMetrics.ALERT_STATUS;
Metric ratingMetric = mock(Metric.class);
when(ratingMetric.getType()).thenReturn(ValueType.RATING);
Metric classicMetric = mock(Metric.class);
when(classicMetric.getType()).thenReturn(ValueType.BOOL);
when(metricFinder.findAll()).thenReturn(ImmutableList.of(
dataMetric, hiddenMetric, nullHiddenMetric, alertMetric, ratingMetric, classicMetric));
assertThat(qGates.gateMetrics()).hasSize(3).containsOnly(classicMetric, hiddenMetric, nullHiddenMetric);
}