Reactor系列(十九)StepVerifier测试

java#reactor#flux#StepVerifier

测试

视频讲解: https://www.bilibili.com/vide...

Reactor系列(十九)StepVerifier测试_第1张图片
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 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分钟视频学习
Reactor系列(十九)StepVerifier测试_第2张图片

你可能感兴趣的:(java,reactor,flux,测试)