Skip to content

Commit 4b5ddd5

Browse files
committed
java: Use countMostSevereTestStepResultStatus from query
1 parent 9e65d9b commit 4b5ddd5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

java/src/main/java/io/cucumber/junitxmlformatter/XmlReportData.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323

2424
import static io.cucumber.messages.types.TestStepResultStatus.PASSED;
2525
import static java.util.concurrent.TimeUnit.SECONDS;
26-
import static java.util.function.Function.identity;
27-
import static java.util.stream.Collectors.counting;
28-
import static java.util.stream.Collectors.groupingBy;
2926
import static java.util.stream.Collectors.toList;
3027

3128
class XmlReportData {
@@ -56,14 +53,7 @@ void collect(Envelope envelope) {
5653
}
5754

5855
Map<TestStepResultStatus, Long> getTestCaseStatusCounts() {
59-
// @formatter:off
60-
return query.findAllTestCaseStarted().stream()
61-
.map(query::findMostSevereTestStepResulBy)
62-
.filter(Optional::isPresent)
63-
.map(Optional::get)
64-
.map(TestStepResult::getStatus)
65-
.collect(groupingBy(identity(), counting()));
66-
// @formatter:on
56+
return query.countMostSevereTestStepResultStatus();
6757
}
6858

6959
int getTestCaseCount() {

0 commit comments

Comments
 (0)