@Test @Ignore("Fusion not supported yet") // TODO decide/implement fusion public void fusedAsync() { TestObserver<Integer> to = ObserverFusion.newTest(QueueFuseable.ANY); final int[] call = { 0, 0 }; UnicastSubject<Integer> up = UnicastSubject.create(); up .doOnNext(new Consumer<Integer>() { @Override public void accept(Integer v) throws Exception { call[0]++; } }) .doOnComplete(new Action() { @Override public void run() throws Exception { call[1]++; } }) .subscribe(to); TestHelper.emit(up, 1, 2, 3, 4, 5); to.assertOf(ObserverFusion.<Integer>assertFuseable()) .assertOf(ObserverFusion.<Integer>assertFusionMode(QueueFuseable.ASYNC)) .assertResult(1, 2, 3, 4, 5); assertEquals(5, call[0]); assertEquals(1, call[1]); }
@Test @Ignore("Fusion not supported yet") // TODO decide/implement fusion public void fusedAsyncConditional() { TestObserver<Integer> to = ObserverFusion.newTest(QueueFuseable.ANY); final int[] call = { 0, 0 }; UnicastSubject<Integer> up = UnicastSubject.create(); up .doOnNext(new Consumer<Integer>() { @Override public void accept(Integer v) throws Exception { call[0]++; } }) .doOnComplete(new Action() { @Override public void run() throws Exception { call[1]++; } }) .filter(Functions.alwaysTrue()) .subscribe(to); TestHelper.emit(up, 1, 2, 3, 4, 5); to.assertOf(ObserverFusion.<Integer>assertFuseable()) .assertOf(ObserverFusion.<Integer>assertFusionMode(QueueFuseable.ASYNC)) .assertResult(1, 2, 3, 4, 5); assertEquals(5, call[0]); assertEquals(1, call[1]); }
.concatWith(instanceOfFactoryProperties.doOnNext((p) -> propertiesRepository.put(p.getKey(), p.getValue())))