Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void testCompletable() {
- Completable completable = Completable.complete()
- .subscribeOn(Schedulers.trampoline())
- .doOnComplete(() -> {
- throw new RuntimeException();
- });
- Observer<String> delegate = new Observer<String>() {
- @Override
- public void onSubscribe(Disposable d) {
- System.out.println("Obs onSubscribe");
- }
- @Override
- public void onNext(String s) {
- System.out.println("Obs onNext");
- }
- @Override
- public void onError(Throwable e) {
- System.out.println("Obs onError");
- }
- @Override
- public void onComplete() {
- System.out.println("Obs onComplete");
- }
- };
- TestObserver observer = TestObserver.create(delegate);
- completable.subscribe(observer);
- observer.awaitTerminalEvent();
- }
Add Comment
Please, Sign In to add comment