From 3c2f25939d41be094af304f03e5fdd7b66bcf9eb Mon Sep 17 00:00:00 2001 From: Matt Jacobs Date: Tue, 22 Jul 2014 13:38:22 -0700 Subject: [PATCH] Add test of backpressure to OperatorAll --- .../rx/internal/operators/OperatorAllTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rxjava-core/src/test/java/rx/internal/operators/OperatorAllTest.java b/rxjava-core/src/test/java/rx/internal/operators/OperatorAllTest.java index e597f6bd62..067879629c 100644 --- a/rxjava-core/src/test/java/rx/internal/operators/OperatorAllTest.java +++ b/rxjava-core/src/test/java/rx/internal/operators/OperatorAllTest.java @@ -15,6 +15,7 @@ */ package rx.internal.operators; +import static org.junit.Assert.assertFalse; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -25,6 +26,8 @@ import rx.Observer; import rx.functions.Func1; +import java.util.Arrays; + public class OperatorAllTest { @Test @@ -98,4 +101,16 @@ public Boolean call(String s) { verify(observer).onError(error); verifyNoMoreInteractions(observer); } + + @Test + public void testFollowingFirst() { + Observable o = Observable.from(Arrays.asList(1, 3, 5, 6)); + Observable allOdd = o.all(new Func1() { + @Override + public Boolean call(Integer i) { + return i % 2 == 1; + } + }); + assertFalse(allOdd.toBlocking().first()); + } }