@Test public void shouldGetTokenFromAccount() throws Exception { Account mockAccount = mock(Account.class); String tokenFromGoogleAuth = GoogleAuthUtil.getToken(context, mockAccount, scope); AuthToken expectedToken = new AuthToken(tokenFromGoogleAuth, scope); sut.getToken(context, mockAccount, scope).subscribe(testSubscriber); testSubscriber.assertNoErrors(); testSubscriber.assertReceivedOnNext(Arrays.asList(expectedToken)); testSubscriber.assertCompleted(); }
@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);  }