spring-attic / reactive-streams-commons

A joint research effort for building highly optimized Reactive-Streams compliant operators.
Apache License 2.0
357 stars 51 forks source link

TestSubscriber constructor with delegate Subscriber #3

Closed sdeleuze closed 8 years ago

sdeleuze commented 8 years ago

In Reactor I have created a TestSubscriber inspired from the one of RSC, and I have a question.

I am not sure if we want (on Reactor side) to keep constructors using a delegate Subscriber because I am not sure about the use cases, could you please give me some hints about what use cases they fit in?

Thanks in advance for your help.

akarnokd commented 8 years ago

It is a remnant of RxJava's TestSubscriber. Some people like to verify event ordering via Mockito yet they need await() to make sure the source completes. This constructor allows you to forward events to this mock. I personally don't use Mockito anymore as the assertX of the TestSubscriber is quite enough for the Rsc's unit tests.

sdeleuze commented 8 years ago

Ok thanks!