@@ -73,8 +73,8 @@ public Observable<Integer> call() {
73
73
}
74
74
75
75
@ Test
76
- public void testTimeoutSelectorTimeoutFirst () {
77
- PublishSubject <Integer > source = PublishSubject . create ();
76
+ public void testTimeoutSelectorTimeoutFirst () throws InterruptedException {
77
+ Observable <Integer > source = Observable .< Integer > never ();
78
78
final PublishSubject <Integer > timeout = PublishSubject .create ();
79
79
80
80
Func1 <Integer , Observable <Integer >> timeoutFunc = new Func1 <Integer , Observable <Integer >>() {
@@ -97,10 +97,10 @@ public Observable<Integer> call() {
97
97
Observer <Object > o = mock (Observer .class );
98
98
InOrder inOrder = inOrder (o );
99
99
100
- source .toObservable (). timeout (firstTimeoutFunc , timeoutFunc , other ).subscribe (new TestObserver <Object >(o ));
101
-
100
+ source .timeout (firstTimeoutFunc , timeoutFunc , other ).subscribe (new TestObserver <Object >(o ));
101
+
102
102
timeout .onNext (1 );
103
-
103
+
104
104
inOrder .verify (o ).onNext (100 );
105
105
inOrder .verify (o ).onCompleted ();
106
106
verify (o , never ()).onError (any (Throwable .class ));
@@ -109,7 +109,7 @@ public Observable<Integer> call() {
109
109
110
110
@ Test
111
111
public void testTimeoutSelectorFirstThrows () {
112
- PublishSubject <Integer > source = PublishSubject . create ();
112
+ Observable <Integer > source = Observable .< Integer > never ();
113
113
final PublishSubject <Integer > timeout = PublishSubject .create ();
114
114
115
115
Func1 <Integer , Observable <Integer >> timeoutFunc = new Func1 <Integer , Observable <Integer >>() {
@@ -131,7 +131,7 @@ public Observable<Integer> call() {
131
131
@ SuppressWarnings ("unchecked" )
132
132
Observer <Object > o = mock (Observer .class );
133
133
134
- source .toObservable (). timeout (firstTimeoutFunc , timeoutFunc , other ).subscribe (new TestObserver <Object >(o ));
134
+ source .timeout (firstTimeoutFunc , timeoutFunc , other ).subscribe (new TestObserver <Object >(o ));
135
135
136
136
verify (o ).onError (any (OperationReduceTest .CustomException .class ));
137
137
verify (o , never ()).onNext (any ());
0 commit comments