@Test public void reauthenticateAndRetrieveData() { TestObserver<AuthResult> userTestObserver = RxFirebaseUser.reauthenticateAndRetrieveData(firebaseUser, authCredential).test(); testOnSuccessListener.getValue().onSuccess(authResult); testOnCompleteListener.getValue().onComplete(authResultTask); verify(firebaseUser).reauthenticateAndRetrieveData(authCredential); userTestObserver.assertNoErrors() .assertValueCount(1) .assertComplete() .assertValueSet(Collections.singletonList(authResult)) .dispose(); }
@NonNull public static Maybe<AuthResult> reauthenticateAndRetrieveData(@NonNull final FirebaseUser firebaseUser, @NonNull final AuthCredential credential) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseUser.reauthenticateAndRetrieveData(credential)); } }); }
RxFirebaseUser { @NonNull public static Maybe<AuthResult> reauthenticateAndRetrieveData(@NonNull final FirebaseUser firebaseUser, @NonNull final AuthCredential credential) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseUser.reauthenticateAndRetrieveData(credential)); } }); } }
RxFirebaseUser { @NonNull public static Maybe<AuthResult> reauthenticateAndRetrieveData(@NonNull final FirebaseUser firebaseUser, @NonNull final AuthCredential credential) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseUser.reauthenticateAndRetrieveData(credential)); } }); }  }
RxFirebaseUser { @NonNull public static Maybe<AuthResult> reauthenticateAndRetrieveData(@NonNull final FirebaseUser firebaseUser, @NonNull final AuthCredential credential) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseUser.reauthenticateAndRetrieveData(credential)); } }); }  @NonNull static Maybe<GetTokenResult> getIdToken(@NonNull final FirebaseUser firebaseUser,
                                                   final boolean forceRefresh); @NonNull static Completable updateEmail(@NonNull final FirebaseUser firebaseUser,
                                          @NonNull final String email); @NonNull static Completable updatePassword(@NonNull final FirebaseUser firebaseUser,
                                             @NonNull final String password); @NonNull static Completable updateProfile(@NonNull final FirebaseUser firebaseUser,
                                            @NonNull final UserProfileChangeRequest request); @NonNull static Completable delete(@NonNull final FirebaseUser firebaseUser); @NonNull static Completable reAuthenticate(@NonNull final FirebaseUser firebaseUser,
                                             @NonNull final AuthCredential credential); @NonNull static Completable reload(@NonNull final FirebaseUser firebaseUser); @NonNull static Completable sendEmailVerification(@NonNull final FirebaseUser firebaseUser); @NonNull static Maybe<AuthResult> linkWithCredential(@NonNull final FirebaseUser firebaseUser,
                                                       @NonNull final AuthCredential credential); @NonNull static Maybe<AuthResult> unlink(@NonNull final FirebaseUser firebaseUser,
                                           @NonNull final String provider); @NonNull static Completable updatePhoneNumber(@NonNull final FirebaseUser firebaseUser,
                                                @NonNull final PhoneAuthCredential phoneAuthCredential); @NonNull static Maybe<AuthResult> reauthenticateAndRetrieveData(@NonNull final FirebaseUser firebaseUser,
                                                                  @NonNull final AuthCredential credential); }
RxFirebaseUser { @NonNull public static Maybe<AuthResult> reauthenticateAndRetrieveData(@NonNull final FirebaseUser firebaseUser, @NonNull final AuthCredential credential) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseUser.reauthenticateAndRetrieveData(credential)); } }); }  @NonNull static Maybe<GetTokenResult> getIdToken(@NonNull final FirebaseUser firebaseUser,
                                                   final boolean forceRefresh); @NonNull static Completable updateEmail(@NonNull final FirebaseUser firebaseUser,
                                          @NonNull final String email); @NonNull static Completable updatePassword(@NonNull final FirebaseUser firebaseUser,
                                             @NonNull final String password); @NonNull static Completable updateProfile(@NonNull final FirebaseUser firebaseUser,
                                            @NonNull final UserProfileChangeRequest request); @NonNull static Completable delete(@NonNull final FirebaseUser firebaseUser); @NonNull static Completable reAuthenticate(@NonNull final FirebaseUser firebaseUser,
                                             @NonNull final AuthCredential credential); @NonNull static Completable reload(@NonNull final FirebaseUser firebaseUser); @NonNull static Completable sendEmailVerification(@NonNull final FirebaseUser firebaseUser); @NonNull static Maybe<AuthResult> linkWithCredential(@NonNull final FirebaseUser firebaseUser,
                                                       @NonNull final AuthCredential credential); @NonNull static Maybe<AuthResult> unlink(@NonNull final FirebaseUser firebaseUser,
                                           @NonNull final String provider); @NonNull static Completable updatePhoneNumber(@NonNull final FirebaseUser firebaseUser,
                                                @NonNull final PhoneAuthCredential phoneAuthCredential); @NonNull static Maybe<AuthResult> reauthenticateAndRetrieveData(@NonNull final FirebaseUser firebaseUser,
                                                                  @NonNull final AuthCredential credential);  }