File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
rxjava-core/src/main/java/rx Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -2598,8 +2598,8 @@ public Observable<Notification<T>> materialize() {
2598
2598
* if attempted on Observable not of type {@code Observable<Notification<T>>}.
2599
2599
*/
2600
2600
@ SuppressWarnings ("unchecked" )
2601
- public Observable <T > dematerialize () {
2602
- return dematerialize ((Observable <Notification <T >>) this );
2601
+ public < T2 > Observable <T2 > dematerialize () {
2602
+ return dematerialize ((Observable <Notification <T2 >>)this );
2603
2603
}
2604
2604
2605
2605
/**
@@ -3461,6 +3461,19 @@ public void testLastEmptyObservable() {
3461
3461
assertNull (obs .last ());
3462
3462
}
3463
3463
3464
+ @ Test
3465
+ public void testMaterializeDematerializeChaining () {
3466
+ Observable <Integer > obs = Observable .just (1 );
3467
+ Observable <Integer > chained = obs .materialize ().dematerialize ();
3468
+
3469
+ Observer <Integer > observer = mock (Observer .class );
3470
+ chained .subscribe (observer );
3471
+
3472
+ verify (observer , times (1 )).onNext (1 );
3473
+ verify (observer , times (1 )).onCompleted ();
3474
+ verify (observer , times (0 )).onError (any (Exception .class ));
3475
+ }
3476
+
3464
3477
private static class TestException extends RuntimeException {
3465
3478
private static final long serialVersionUID = 1L ;
3466
3479
}
You can’t perform that action at this time.
0 commit comments