}
@Test
- public void ignore_person_measures() throws Exception {
+ public void ignore_person_measures_in_condition() throws Exception {
setupData("ignore_person_measures");
MeasureFilter filter = new MeasureFilter().setResourceQualifiers(Arrays.asList("TRK")).addCondition(
new MeasureFilterCondition(new Metric("ncloc").setId(1), MeasureFilterCondition.Operator.GREATER, 0.0)
}
@Test
- public void ignore_quality_model_measures() throws Exception {
+ public void ignore_person_measures_in_sort() throws Exception {
+ setupData("ignore_person_measures");
+ MeasureFilter filter = new MeasureFilter().setResourceQualifiers(Arrays.asList("TRK")).setSortOnMetric(new Metric("ncloc").setId(1));
+ List<MeasureFilterRow> rows = executor.execute(filter, new MeasureFilterContext().setUserId(50L));
+
+ assertThat(rows).hasSize(1);
+ assertThat(rows.get(0).getSnapshotId()).isEqualTo(101L);
+ }
+
+ @Test
+ public void ignore_quality_model_measures_in_condition() throws Exception {
setupData("ignore_quality_model_measures");
MeasureFilter filter = new MeasureFilter().setResourceQualifiers(Arrays.asList("TRK")).addCondition(
new MeasureFilterCondition(new Metric("ncloc").setId(1), MeasureFilterCondition.Operator.GREATER, 0.0)
assertThat(rows.get(0).getSnapshotId()).isEqualTo(101L);
}
+ @Test
+ public void ignore_quality_model_measures_in_sort() throws Exception {
+ setupData("ignore_quality_model_measures");
+ MeasureFilter filter = new MeasureFilter().setResourceQualifiers(Arrays.asList("TRK")).setSortOnMetric(new Metric("ncloc").setId(1));
+ List<MeasureFilterRow> rows = executor.execute(filter, new MeasureFilterContext().setUserId(50L));
+
+ assertThat(rows).hasSize(1);
+ assertThat(rows.get(0).getSnapshotId()).isEqualTo(101L);
+ }
+
+
private void verifyJavaProject(MeasureFilterRow row) {
assertThat(row.getSnapshotId()).isEqualTo(JAVA_PROJECT_SNAPSHOT_ID);
assertThat(row.getResourceId()).isEqualTo(JAVA_PROJECT_ID);