public Stream<ExecutionEvent> getFinishedEventsByStatus(Status status) { return getEventsByType(FINISHED) .filter( byPayload( TestExecutionResult.class, where(TestExecutionResult::getStatus, isEqual(status)))); }
public static Condition<TestExecutionResult> status(Status expectedStatus) { return new Condition<>(where(TestExecutionResult::getStatus, isEqual(expectedStatus)), "status is %s", expectedStatus); }
private static Condition<ExecutionEvent> finishedWithCause(Status expectedStatus, Condition<? super Throwable> causeCondition) { return finished(allOf(status(expectedStatus), cause(causeCondition))); }
public long getTestSuccessfulCount() { return getTestFinishedCount(Status.SUCCESSFUL); }
public long getTestAbortedCount() { return getTestFinishedCount(Status.ABORTED); }
public long getTestFailedCount() { return getTestFinishedCount(Status.FAILED); }
public List<ExecutionEvent> getSuccessfulTestFinishedEvents() { return testFinishedEvents(Status.SUCCESSFUL).collect(toList()); }
public List<ExecutionEvent> getFailedTestFinishedEvents() { return testFinishedEvents(Status.FAILED).collect(toList()); }
private long getTestFinishedCount(Status status) { return testFinishedEvents(status).count(); }
private Stream<ExecutionEvent> testFinishedEvents(Status status) { return testEventsByType(FINISHED).filter( byPayload(TestExecutionResult.class, where(TestExecutionResult::getStatus, isEqual(status)))); }