@Override public CompletableSource apply(Integer v) throws Exception { return Completable.complete(); } };
@Override public CompletableSource apply(Object v) throws Exception { return Completable.complete(); } }, new Consumer<Object>() {
@Override public CompletableSource apply(Object v) throws Exception { return Completable.complete(); } }, new Consumer<Object>() {
@Override public CompletableSource apply(Integer v) throws Exception { return Completable.complete(); } }, true, Integer.MAX_VALUE).toFlowable()
@Override public CompletableSource apply(Integer v) throws Exception { return Completable.complete(); } }, false, Integer.MAX_VALUE).toFlowable()
@Override public CompletableSource apply(Integer v) throws Exception { return Completable.complete(); } }).<Integer>toFlowable()
@Override public CompletableSource apply(Integer v) throws Exception { return Completable.complete(); } }).toObservable()
@Override public CompletableSource apply(Integer v) throws Exception { return Completable.complete(); } }));
@Override public Completable apply(Observable<Object> f) throws Exception { return f.concatMapCompletable( Functions.justFunction(Completable.complete())); } }
@Test public void ambIterableOrder() { Completable error = Completable.error(new RuntimeException()); Completable.amb(Arrays.asList(Completable.complete(), error)).test().assertComplete(); }
@Test public void invalidPrefetch() { try { Completable.merge(Flowable.just(Completable.complete()), -99); fail("Should have thrown IllegalArgumentExceptio"); } catch (IllegalArgumentException ex) { assertEquals("maxConcurrency > 0 required but it was -99", ex.getMessage()); } }
@Test public void onComplete() { Completable.complete() .onTerminateDetach() .test() .assertResult(); }
@Test public void completableToMaybe() { Completable.complete() .toMaybe() .test() .assertResult(); }
@Test public void source() { Completable c = Completable.complete(); assertSame(c, ((HasUpstreamCompletableSource)Maybe.fromCompletable(c)).source()); }
@Test @SuppressWarnings("unchecked") public void empty() { Completable.complete() .materialize() .test() .assertResult(Notification.createOnComplete()); }
@Test public void delayCustomScheduler() { Completable.complete() .delay(100, TimeUnit.MILLISECONDS, Schedulers.trampoline()) .test() .assertResult(); }
@Test public void simpleLongPrefetch() { Observable.range(1, 1024) .concatMapCompletable(Functions.justFunction(Completable.complete()), 32) .test() .assertResult(); }
@Test public void simpleLongPrefetch() { Flowable.range(1, 1024) .concatMapCompletable(Functions.justFunction(Completable.complete()), 32) .test() .assertResult(); }
@Test public void completeAfterMain() { PublishProcessor<Integer> pp = PublishProcessor.create(); TestObserver<Void> to = Completable.mergeArray(Completable.complete(), pp.ignoreElements()) .test(); pp.onComplete(); to.assertResult(); }
@Test public void andThenSingle() { TestSubscriber<String> ts = new TestSubscriber<String>(0); Completable.complete().andThen(Single.just("foo")).toFlowable().subscribe(ts); ts.request(1); ts.assertValue("foo"); ts.assertComplete(); ts.assertNoErrors(); }