RxLogin { public boolean onActivityResult(int requestCode, int resultCode, Intent data) { if (mCallbackManager != null) { return mCallbackManager.onActivityResult(requestCode, resultCode, data); } if (mTwitterClient != null) { mTwitterClient.onActivityResult(requestCode, resultCode, data); } if (mGoogleCallback != null) { if (requestCode == RC_SIGN_IN) { if (resultCode == Activity.RESULT_CANCELED) { mGoogleCallback.onCancel(); } else { GoogleSignInResult r = Auth.GoogleSignInApi.getSignInResultFromIntent(data); if (r != null && r.isSuccess()) { mGoogleCallback.onSuccess(r); } else { mGoogleCallback.onError(r); } } } return true; } return false; }  Flowable<LoginResult> loginFacebook(Activity activity, boolean publish,
        List<String> permissions); Flowable<GoogleSignInResult> loginGoogle(Activity activity, @NonNull Scope scope,
        Scope... scopes); Flowable<GoogleSignInResult> loginGoogle(Activity activity, @NonNull String
        webClientId, @NonNull Scope scope, Scope... scopes); Flowable<Result<TwitterSession>> loginTwitter(Activity activity); void registerCallback(final FacebookCallback<LoginResult> callback); void registerCallback(GoogleCallback callback); void registerCallback(Callback<TwitterSession> callback); boolean onActivityResult(int requestCode, int resultCode, Intent data);  }
@Test public void testOnActivityResultForFacebook() { mRxLogin.mCallbackManager = mock(com.facebook.CallbackManager.class); mRxLogin.onActivityResult(1234, Activity.RESULT_OK, mTestIntent); verify(mRxLogin.mCallbackManager).onActivityResult(eq(1234), eq(-1), eq(mTestIntent)); }
@Test public void testOnActivityResultForGoogle() { mRxLogin.mGoogleCallback = mock(GoogleCallback.class); mRxLogin.onActivityResult(5712, Activity.RESULT_CANCELED, mTestIntent); verify(mRxLogin.mGoogleCallback).onCancel(); mRxLogin.onActivityResult(5712, Activity.RESULT_OK, mTestIntent); verify(mRxLogin.mGoogleCallback).onError(eq(null)); }