I would like to verify that every onNext emission matches the given predicate.
I tried expectNextMatches:
StepVerifier.create(...)
.expectNextMatches { it.status != "SUCCESS" }
.expectComplete()
.verify()
However, it matches only one emission, not every single one.
There's an operator for that:
StepVerifier.create(...)
.thenConsumeWhile(it -> it.status != "SUCCESS")
.expectComplete()
.verify();
If there is any element in the sequence that doesn't match, the StepVerifier will error.