use of io.reactivex.flowables.ConnectableFlowable in project brave by openzipkin.
the class CurrentTraceContextAssemblyTrackingMatrixTest method connectableFlowable_assembleInScope_subscribeNoScope.
@Test
public void connectableFlowable_assembleInScope_subscribeNoScope() {
ConnectableFlowable<Integer> source, errorSource;
try (Scope scope = currentTraceContext.newScope(assemblyContext)) {
source = Flowable.range(1, 3).doOnNext(e -> assertInAssemblyContext()).doOnComplete(this::assertInAssemblyContext).publish();
errorSource = Flowable.<Integer>error(new IllegalStateException()).doOnError(t -> assertInAssemblyContext()).doOnComplete(this::assertInAssemblyContext).publish();
}
subscribeInNoContext(source.autoConnect().toObservable(), errorSource.autoConnect().toObservable()).assertResult(1, 2, 3);
}
use of io.reactivex.flowables.ConnectableFlowable in project brave by openzipkin.
the class CurrentTraceContextAssemblyTrackingMatrixTest method connectableFlowable_assembleInScope_subscribeInScope.
@Test
public void connectableFlowable_assembleInScope_subscribeInScope() {
ConnectableFlowable<Integer> source, errorSource;
try (Scope scope = currentTraceContext.newScope(assemblyContext)) {
source = Flowable.range(1, 3).doOnNext(e -> assertInAssemblyContext()).doOnComplete(this::assertInAssemblyContext).publish();
errorSource = Flowable.<Integer>error(new IllegalStateException()).doOnError(t -> assertInAssemblyContext()).doOnComplete(this::assertInAssemblyContext).publish();
}
subscribeInDifferentContext(source.autoConnect().toObservable(), errorSource.autoConnect().toObservable()).assertResult(1, 2, 3);
}
Aggregations