Skip to content

Commit

Permalink
java: Use countMostSevereTestStepResultStatus from query
Browse files Browse the repository at this point in the history
  • Loading branch information
mpkorstanje committed Nov 3, 2024
1 parent 9e65d9b commit 4b5ddd5
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

import static io.cucumber.messages.types.TestStepResultStatus.PASSED;
import static java.util.concurrent.TimeUnit.SECONDS;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.counting;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toList;

class XmlReportData {
Expand Down Expand Up @@ -56,14 +53,7 @@ void collect(Envelope envelope) {
}

Map<TestStepResultStatus, Long> getTestCaseStatusCounts() {
// @formatter:off
return query.findAllTestCaseStarted().stream()
.map(query::findMostSevereTestStepResulBy)
.filter(Optional::isPresent)
.map(Optional::get)
.map(TestStepResult::getStatus)
.collect(groupingBy(identity(), counting()));
// @formatter:on
return query.countMostSevereTestStepResultStatus();
}

int getTestCaseCount() {
Expand Down

0 comments on commit 4b5ddd5

Please sign in to comment.