jjzjj

StepVerifier

全部标签

java - 如何使用 Reactor 的 StepVerifier 来验证 Mono 是否为空?

我正在使用StepVerifier来测试值:@TestpublicvoidtestStuff(){Thingthing=newThing();Monoresult=Mono.just(thing);StepVerifier.create(result).consumeNextWith(r->{assertEquals(thing,r);}).verifyComplete();}我现在想做的是测试Mono中是否缺少某个项目。像这样:@TestpublicvoidtestNoStuff(){Monoresult=Mono.empty();StepVerifier.create(result