.containsExactly("path-9", "path-8", "path-7", "path-6", "path-5", "path-4", "path-3", "path-2", "path-1", "path-without-measure");
}
+ @Test
+ public void sort_by_name_ascending_in_case_of_equality() {
+ components = newArrayList(
+ newComponentWithoutSnapshotId("PROJECT 12", Qualifiers.PROJECT, "PROJECT_PATH_1"),
+ newComponentWithoutSnapshotId("PROJECT 11", Qualifiers.PROJECT, "PROJECT_PATH_1"),
+ newComponentWithoutSnapshotId("PROJECT 0", Qualifiers.PROJECT, "PROJECT_PATH_2"));
+
+ ComponentTreeWsRequest wsRequest = newRequest(newArrayList(PATH_SORT), false, null);
+
+ List<ComponentDto> result = sortComponents(wsRequest);
+
+ assertThat(result).extracting("name").containsExactly("PROJECT 0", "PROJECT 11", "PROJECT 12");
+ }
+
@Test
public void sort_by_alert_status_ascending() {
components = newArrayList(
opts.asc = metric.direction === 1;
opts.ps = 100;
opts.metricSort = metric.key;
- opts.s = isDiff ? 'metricPeriod,name' : 'metric,name';
+ opts.s = isDiff ? 'metricPeriod' : 'metric';
}
return { metricKeys, opts: { ...opts, ...options }, strategy };
};