@@ -58,7 +58,7 @@ def class ObservableTests {
58
58
59
59
@Test
60
60
public void testFilter () {
61
- Observable . filter( Observable . from(1 , 2 , 3 ), {it >= 2 }). subscribe({ result -> a. received(result)});
61
+ Observable . from(1 , 2 , 3 ). filter( {it >= 2 }). subscribe({ result -> a. received(result)});
62
62
verify(a, times(0 )). received(1 );
63
63
verify(a, times(1 )). received(2 );
64
64
verify(a, times(1 )). received(3 );
@@ -82,15 +82,15 @@ def class ObservableTests {
82
82
83
83
@Test
84
84
public void testMap2 () {
85
- Observable . map( Observable . from(1 , 2 , 3 ), {' hello_' + it}). subscribe({ result -> a. received(result)});
85
+ Observable . from(1 , 2 , 3 ). map( {' hello_' + it}). subscribe({ result -> a. received(result)});
86
86
verify(a, times(1 )). received(" hello_" + 1 );
87
87
verify(a, times(1 )). received(" hello_" + 2 );
88
88
verify(a, times(1 )). received(" hello_" + 3 );
89
89
}
90
90
91
91
@Test
92
92
public void testMaterialize () {
93
- Observable . materialize( Observable . from(1 , 2 , 3 )). subscribe({ result -> a. received(result)});
93
+ Observable . from(1 , 2 , 3 ). materialize( ). subscribe({ result -> a. received(result)});
94
94
// we expect 4 onNext calls: 3 for 1, 2, 3 ObservableNotification.OnNext and 1 for ObservableNotification.OnCompleted
95
95
verify(a, times(4 )). received(any(Notification . class));
96
96
verify(a, times(0 )). error(any(Exception . class));
@@ -162,23 +162,23 @@ def class ObservableTests {
162
162
163
163
@Test
164
164
public void testSkipTake () {
165
- Observable . skip( Observable . from(1 , 2 , 3 ), 1 ). take(1 ). subscribe({ result -> a. received(result)});
165
+ Observable . from(1 , 2 , 3 ). skip( 1 ). take(1 ). subscribe({ result -> a. received(result)});
166
166
verify(a, times(0 )). received(1 );
167
167
verify(a, times(1 )). received(2 );
168
168
verify(a, times(0 )). received(3 );
169
169
}
170
170
171
171
@Test
172
172
public void testSkip () {
173
- Observable . skip( Observable . from(1 , 2 , 3 ), 2 ). subscribe({ result -> a. received(result)});
173
+ Observable . from(1 , 2 , 3 ). skip( 2 ). subscribe({ result -> a. received(result)});
174
174
verify(a, times(0 )). received(1 );
175
175
verify(a, times(0 )). received(2 );
176
176
verify(a, times(1 )). received(3 );
177
177
}
178
178
179
179
@Test
180
180
public void testTake () {
181
- Observable . take( Observable . from(1 , 2 , 3 ), 2 ). subscribe({ result -> a. received(result)});
181
+ Observable . from(1 , 2 , 3 ). take( 2 ). subscribe({ result -> a. received(result)});
182
182
verify(a, times(1 )). received(1 );
183
183
verify(a, times(1 )). received(2 );
184
184
verify(a, times(0 )). received(3 );
@@ -192,15 +192,15 @@ def class ObservableTests {
192
192
193
193
@Test
194
194
public void testTakeWhileViaGroovy () {
195
- Observable . takeWhile( Observable . from(1 , 2 , 3 ), { x -> x < 3 }). subscribe({ result -> a. received(result)});
195
+ Observable . from(1 , 2 , 3 ). takeWhile( { x -> x < 3 }). subscribe({ result -> a. received(result)});
196
196
verify(a, times(1 )). received(1 );
197
197
verify(a, times(1 )). received(2 );
198
198
verify(a, times(0 )). received(3 );
199
199
}
200
200
201
201
@Test
202
202
public void testTakeWhileWithIndexViaGroovy () {
203
- Observable . takeWhileWithIndex( Observable . from(1 , 2 , 3 ), { x , i -> i < 2 }). subscribe({ result -> a. received(result)});
203
+ Observable . from(1 , 2 , 3 ). takeWhileWithIndex( { x , i -> i < 2 }). subscribe({ result -> a. received(result)});
204
204
verify(a, times(1 )). received(1 );
205
205
verify(a, times(1 )). received(2 );
206
206
verify(a, times(0 )). received(3 );
@@ -212,24 +212,12 @@ def class ObservableTests {
212
212
verify(a, times(1 )). received(Arrays . asList(1 , 2 , 3 , 4 , 5 ));
213
213
}
214
214
215
- @Test
216
- public void testToSortedListStatic () {
217
- Observable . toSortedList(Observable . from(1 , 3 , 2 , 5 , 4 )). subscribe({ result -> a. received(result)});
218
- verify(a, times(1 )). received(Arrays . asList(1 , 2 , 3 , 4 , 5 ));
219
- }
220
-
221
215
@Test
222
216
public void testToSortedListWithFunction () {
223
217
new TestFactory (). getNumbers(). toSortedList({a , b -> a - b}). subscribe({ result -> a. received(result)});
224
218
verify(a, times(1 )). received(Arrays . asList(1 , 2 , 3 , 4 , 5 ));
225
219
}
226
220
227
- @Test
228
- public void testToSortedListWithFunctionStatic () {
229
- Observable . toSortedList(Observable . from(1 , 3 , 2 , 5 , 4 ), {a , b -> a - b}). subscribe({ result -> a. received(result)});
230
- verify(a, times(1 )). received(Arrays . asList(1 , 2 , 3 , 4 , 5 ));
231
- }
232
-
233
221
@Test
234
222
public void testForEach () {
235
223
Observable . create(new AsyncObservable ()). toBlockingObservable(). forEach({ result -> a. received(result)});
0 commit comments