Reputation: 928
I am using SpringWebflux to playground some tests.
I am getting one highlight in IDE, saing "Unfinished Step Verifier"
Thats my code:
@Test
public void findAllNextMatches() {
StepVerifier
.create(repo.findAll())
.expectNextMatches(u -> u.getId()
.equals(cust1.getId()))
.expectComplete();
}
The IntellijIdea Highlight "expectComplete", and complain saying: "Unfinished Step Verifier".
How Can I finish the test properly , in order to avoid, the complaiment above?
Thanks a lot, in advance
Upvotes: 0
Views: 1198
Reputation: 7563
I would suggest to use the verifyComplete()
instead of the simple verify()
, because you can avoid the .expectComplete()
since you know that the test must return something.
I use verify()
when the test must NOT return any value but I need to execute the Flux.
The docs also suggest
This is a convenience method that calls StepVerifier.verify() in addition to the expectation.
Upvotes: 3
Reputation: 1082
Add at the end
.verify();
Source: https://projectreactor.io/docs/test/release/api/index.html?reactor/test/StepVerifier.html
Upvotes: 3