#java#reactor#flux#StepVerifier#
测试
视频讲解: https://www.bilibili.com/video/av81866573/
FluxMonoTestCase.java
package com.example.reactor;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;
import reactor.test.StepVerifier;
@Slf4j
public class FluxMonoTestCase extends BaseTestCase {
@Test
public void verify(){
Flux<Integer> integerFlux = Flux.range(1,5);
integerFlux.subscribe(x ->System.out.print("->"+x));
StepVerifier.create(integerFlux)
.expectNext(1)
.expectNext(2)
.expectNext(3,4,5)
.expectComplete()
.verify();
}
}
公众号,坚持每天3分钟视频学习