Debian Codegraph @

src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleConcatDelayErrorTest.java

raw
1 /*
2 * Copyright (c) 2016-present, RxJava Contributors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 * compliance with the License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 * the License for the specific language governing permissions and limitations under the License.
12 */
13
14 package io.reactivex.rxjava3.internal.operators.single;
15
16 import java.util.Arrays;
17
18 import org.junit.Test;
19
20 import io.reactivex.rxjava3.core.*;
21 import io.reactivex.rxjava3.exceptions.TestException;
22
23 public class SingleConcatDelayErrorTest {
24
25 @Test
26 public void normalIterable() {
27 Single.concatDelayError(Arrays.asList(
28 Single.just(1),
29 Single.<Integer>error(new TestException()),
30 Single.just(2)
31 ))
32 .test()
33 .assertFailure(TestException.class, 1, 2);
34 }
35
36 @Test
37 public void normalPublisher() {
38 Single.concatDelayError(Flowable.fromArray(
39 Single.just(1),
40 Single.<Integer>error(new TestException()),
41 Single.just(2)
42 ))
43 .test()
44 .assertFailure(TestException.class, 1, 2);
45 }
46
47 @Test
48 public void normalPublisherPrefetch() {
49 Single.concatDelayError(Flowable.fromArray(
50 Single.just(1),
51 Single.<Integer>error(new TestException()),
52 Single.just(2)
53 ), 1)
54 .test()
55 .assertFailure(TestException.class, 1, 2);
56 }
57
58 }