为什么Reactor.core.publisher.Hooks.onOperatorDebug()修复单元测试?

时间:2018-12-23 21:37:16

标签: project-reactor

当我运行一个单元测试并调用返回一个Flux的方法时,我得到以下StackTrace:

java.lang.ClassCastException: reactor.core.publisher.FluxMap$MapSubscriber cannot be cast to reactor.core.Fuseable$QueueSubscription

    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:89)
    at reactor.core.publisher.FluxMap$MapSubscriber.onSubscribe(FluxMap.java:86)
    at reactor.core.publisher.FluxSwitchMap$SwitchMapMain.onSubscribe(FluxSwitchMap.java:191)
    at reactor.core.publisher.FluxCombineLatest.subscribe(FluxCombineLatest.java:174)
    at reactor.core.publisher.FluxSwitchMap.subscribe(FluxSwitchMap.java:84)
    at reactor.core.publisher.FluxMap.subscribe(FluxMap.java:62)
    at reactor.core.publisher.FluxCombineLatest.subscribe(FluxCombineLatest.java:164)
    at reactor.core.publisher.FluxMapFuseable.subscribe(FluxMapFuseable.java:63)
    at reactor.core.publisher.Flux.subscribe(Flux.java:6877)

    ...

    at reactor.core.publisher.FluxMapFuseable.subscribe(FluxMapFuseable.java:63)
    at reactor.core.publisher.FluxFlatMap.subscribe(FluxFlatMap.java:97)
    at reactor.core.publisher.FluxOnErrorResume.subscribe(FluxOnErrorResume.java:47)
    at reactor.core.publisher.FluxOnErrorResume.subscribe(FluxOnErrorResume.java:47)
    at reactor.core.publisher.Flux.blockFirst(Flux.java:2012)

希望获得更多信息,我在调用反应性方法之前添加了Hooks.onOperatorDebug()。但是,现在没有获得更多信息,而是成功完成了单元测试。这怎么可能?

0 个答案:

没有答案