|
1 | 1 | package io.cucumber.query; |
2 | 2 |
|
3 | 3 | import io.cucumber.messages.Convertor; |
| 4 | +import io.cucumber.messages.TestStepResultStatusComparator; |
| 5 | +import io.cucumber.messages.TimestampComparator; |
4 | 6 | import io.cucumber.messages.types.Attachment; |
5 | 7 | import io.cucumber.messages.types.Envelope; |
6 | 8 | import io.cucumber.messages.types.Examples; |
|
73 | 75 | public final class Query { |
74 | 76 | private static final Map<TestStepResultStatus, Long> ZEROES_BY_TEST_STEP_RESULT_STATUSES = Arrays.stream(TestStepResultStatus.values()) |
75 | 77 | .collect(Collectors.toMap(identity(), (s) -> 0L)); |
76 | | - private final Comparator<TestStepResult> testStepResultComparator = nullsFirst(comparing(o -> o.getStatus().ordinal())); |
| 78 | + private static final Comparator<TestStepResult> testStepResultComparator = comparing(TestStepResult::getStatus, new TestStepResultStatusComparator()); |
77 | 79 | private final Map<String, TestCaseStarted> testCaseStartedById = new ConcurrentHashMap<>(); |
78 | 80 | private final Map<String, TestCaseFinished> testCaseFinishedByTestCaseStartedId = new ConcurrentHashMap<>(); |
79 | 81 | private final Map<String, List<TestStepFinished>> testStepsFinishedByTestCaseStartedId = new ConcurrentHashMap<>(); |
@@ -107,6 +109,7 @@ public int countTestCasesStarted() { |
107 | 109 | } |
108 | 110 |
|
109 | 111 | public List<Pickle> findAllPickles() { |
| 112 | + // TODO: This should sort by URI and location |
110 | 113 | return pickleById.values().stream() |
111 | 114 | .sorted(comparing(Pickle::getId)) |
112 | 115 | .collect(toList()); |
|
0 commit comments