AuthObserver implements Observer<AuthToken> { @Override public void onNext(AuthToken token) { callback.onTokenReceived(token); } AuthObserver(Activity activity, AuthCallback callback); @Override void onCompleted(); @Override void onError(Throwable e); @Override void onNext(AuthToken token); static final int REQUEST_CODE_RECOVER_FROM_PLAY_SERVICES_ERROR; }
@Test public void onNextShouldNotifyCallback() throws Exception { AuthToken mockToken = mock(AuthToken.class); sut.onNext(mockToken); verify(mockCallback).onTokenReceived(mockToken); }