You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TestPublisher<String> result = TestPublisher.create();
assertThat(result.next("value").mono().block()).isEqualTo("value");
Actual behavior
Resolves to null, because by the time the block() is called, the DefaultTestPublisher is already terminated: it had no subscribers when calling next, so it only replays the terminal signal to subsequent subscribers.
Resolution
We need a "cold" implementation of TestPublisher that will replay a sequence to all its Subscribers. Possibly, let the user add signals (via next) or change the termination signal (via error() or complete()) between 2 subscriptions. In that case however, change should only impact the next new subscriber (ie. the publish methods don't impact current subscribers at all).
Reactor Core version
3.1.8+
The text was updated successfully, but these errors were encountered:
Expected behavior
Actual behavior
Resolves to
null
, because by the time theblock()
is called, theDefaultTestPublisher
is already terminated: it had no subscribers when callingnext
, so it only replays the terminal signal to subsequent subscribers.Resolution
We need a "cold" implementation of
TestPublisher
that will replay a sequence to all its Subscribers. Possibly, let the user add signals (vianext
) or change the termination signal (viaerror()
orcomplete()
) between 2 subscriptions. In that case however, change should only impact the next new subscriber (ie. the publish methods don't impact current subscribers at all).Reactor Core version
3.1.8+
The text was updated successfully, but these errors were encountered: