java.lang.Object
io.smallrye.mutiny.helpers.test.AbstractSubscriber<T>
- Type Parameters:
T- the type of the items
- All Implemented Interfaces:
Flow.Subscriber<T>,Flow.Subscription
A convenient base class for a subscriber and subscription to extend in tests and that manages the subscription and
requests.
Implementations shall override onNext(Object),
onError(Throwable) and/or onComplete() to add test-specific
custom logic.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newAbstractSubscriberwith 0 upfront requests.AbstractSubscriber(long req) Creates a newAbstractSubscriberwithrequpfront requests. -
Method Summary
-
Constructor Details
-
AbstractSubscriber
public AbstractSubscriber()Creates a newAbstractSubscriberwith 0 upfront requests. -
AbstractSubscriber
public AbstractSubscriber(long req) Creates a newAbstractSubscriberwithrequpfront requests.- Parameters:
req- the number of upfront requests
-
-
Method Details
-
onSubscribe
- Specified by:
onSubscribein interfaceFlow.Subscriber<T>
-
onNext
- Specified by:
onNextin interfaceFlow.Subscriber<T>
-
onError
- Specified by:
onErrorin interfaceFlow.Subscriber<T>
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceFlow.Subscriber<T>
-
request
public void request(long n) - Specified by:
requestin interfaceFlow.Subscription
-
cancel
public void cancel()- Specified by:
cancelin interfaceFlow.Subscription
-