File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
rxjava-core/src/main/java/rx/operators Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -94,5 +94,28 @@ public void testList() {
94
94
verify (aObserver , Mockito .never ()).onError (any (Exception .class ));
95
95
verify (aObserver , times (1 )).onCompleted ();
96
96
}
97
+
98
+ @ Test
99
+ public void testListMultipleObservers () {
100
+ Observable <String > w = Observable .toObservable ("one" , "two" , "three" );
101
+ Observable <List <String >> observable = Observable .create (toObservableList (w ));
102
+
103
+ @ SuppressWarnings ("unchecked" )
104
+ Observer <List <String >> o1 = mock (Observer .class );
105
+ observable .subscribe (o1 );
106
+
107
+ Observer <List <String >> o2 = mock (Observer .class );
108
+ observable .subscribe (o2 );
109
+
110
+ List <String > expected = Arrays .asList ("one" , "two" , "three" );
111
+
112
+ verify (o1 , times (1 )).onNext (expected );
113
+ verify (o1 , Mockito .never ()).onError (any (Exception .class ));
114
+ verify (o1 , times (1 )).onCompleted ();
115
+
116
+ verify (o2 , times (1 )).onNext (expected );
117
+ verify (o2 , Mockito .never ()).onError (any (Exception .class ));
118
+ verify (o2 , times (1 )).onCompleted ();
119
+ }
97
120
}
98
121
}
You can’t perform that action at this time.
0 commit comments