@Test @Ignore public void shouldNotifyOnError() throws Exception { Exception e = new Exception(); when(GoogleAuthUtil.getToken(context, "email", scope)).thenThrow(e); sut.getToken(context, "email", scope).subscribe(testSubscriber); testSubscriber.assertError(e); }
@Deprecated public Observable<AuthToken> getToken(final Context context, final String email, final String scope) { return Observable.create(new Observable.OnSubscribe<AuthToken>() { @Override public void call(Subscriber<? super AuthToken> observer) { try { String token = GoogleAuthUtil.getToken(context, email, scope); if (!observer.isUnsubscribed()) { observer.onNext(new AuthToken(token, scope)); observer.onCompleted(); } } catch (Exception e) { observer.onError(e); } } }); }
AuthObservable { @Deprecated public Observable<AuthToken> getToken(final Context context, final String email, final String scope) { return Observable.create(new Observable.OnSubscribe<AuthToken>() { @Override public void call(Subscriber<? super AuthToken> observer) { try { String token = GoogleAuthUtil.getToken(context, email, scope); if (!observer.isUnsubscribed()) { observer.onNext(new AuthToken(token, scope)); observer.onCompleted(); } } catch (Exception e) { observer.onError(e); } } }); } }
AuthObservable { @Deprecated public Observable<AuthToken> getToken(final Context context, final String email, final String scope) { return Observable.create(new Observable.OnSubscribe<AuthToken>() { @Override public void call(Subscriber<? super AuthToken> observer) { try { String token = GoogleAuthUtil.getToken(context, email, scope); if (!observer.isUnsubscribed()) { observer.onNext(new AuthToken(token, scope)); observer.onCompleted(); } } catch (Exception e) { observer.onError(e); } } }); }  }
AuthObservable { @Deprecated public Observable<AuthToken> getToken(final Context context, final String email, final String scope) { return Observable.create(new Observable.OnSubscribe<AuthToken>() { @Override public void call(Subscriber<? super AuthToken> observer) { try { String token = GoogleAuthUtil.getToken(context, email, scope); if (!observer.isUnsubscribed()) { observer.onNext(new AuthToken(token, scope)); observer.onCompleted(); } } catch (Exception e) { observer.onError(e); } } }); }  @Deprecated Observable<AuthToken> getToken(final Context context, final String email, final String scope); Observable<AuthToken> getToken(final Context context, final Account account, final String scope); }
AuthObservable { @Deprecated public Observable<AuthToken> getToken(final Context context, final String email, final String scope) { return Observable.create(new Observable.OnSubscribe<AuthToken>() { @Override public void call(Subscriber<? super AuthToken> observer) { try { String token = GoogleAuthUtil.getToken(context, email, scope); if (!observer.isUnsubscribed()) { observer.onNext(new AuthToken(token, scope)); observer.onCompleted(); } } catch (Exception e) { observer.onError(e); } } }); }  @Deprecated Observable<AuthToken> getToken(final Context context, final String email, final String scope); Observable<AuthToken> getToken(final Context context, final Account account, final String scope);  }