Skip to content

Commit

Permalink
Use test() helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Nov 19, 2017
1 parent 5c3bdf3 commit e0d793f
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions src/test/java/io/reactivex/completable/CompletableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2783,32 +2783,30 @@ public void timeoutOtherNull() {

@Test(timeout = 5000)
public void toNormal() {
Flowable<Object> flow = normal.completable.to(new Function<Completable, Flowable<Object>>() {
@Override
public Flowable<Object> apply(Completable c) {
return c.toFlowable();
}
});

flow.blockingForEach(new Consumer<Object>() {
@Override
public void accept(Object e) { }
});
normal.completable
.to(new Function<Completable, Flowable<Object>>() {
@Override
public Flowable<Object> apply(Completable c) {
return c.toFlowable();
}
})
.test()
.assertComplete()
.assertNoValues();
}

@Test(timeout = 5000)
public void asNormal() {
Flowable<Object> flow = normal.completable.as(new CompletableConverter<Flowable<Object>>() {
@Override
public Flowable<Object> apply(Completable c) {
return c.toFlowable();
}
});

flow.blockingForEach(new Consumer<Object>() {
@Override
public void accept(Object e) { }
});
normal.completable
.as(new CompletableConverter<Flowable<Object>>() {
@Override
public Flowable<Object> apply(Completable c) {
return c.toFlowable();
}
})
.test()
.assertComplete()
.assertNoValues();
}

@Test
Expand Down

0 comments on commit e0d793f

Please sign in to comment.