@Test public void signInWithEmailAndPassword() { TestObserver<AuthResult> authTestObserver = RxFirebaseAuth .signInWithEmailAndPassword(firebaseAuth, ANY_EMAIL, ANY_PASSWORD) .test(); testOnSuccessListener.getValue().onSuccess(authResult); testOnCompleteListener.getValue().onComplete(authResultTask); verify(firebaseAuth).signInWithEmailAndPassword(eq(ANY_EMAIL), eq(ANY_PASSWORD)); authTestObserver.assertNoErrors() .assertValueCount(1) .assertValueSet(Collections.singletonList(authResult)) .assertComplete() .dispose(); }
@NonNull public static Maybe<AuthResult> signInWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth, @NonNull final String email, @NonNull final String password) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseAuth.signInWithEmailAndPassword(email, password)); } }); }
RxFirebaseAuth { @NonNull public static Maybe<AuthResult> signInWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth, @NonNull final String email, @NonNull final String password) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseAuth.signInWithEmailAndPassword(email, password)); } }); } }
RxFirebaseAuth { @NonNull public static Maybe<AuthResult> signInWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth, @NonNull final String email, @NonNull final String password) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseAuth.signInWithEmailAndPassword(email, password)); } }); }  }
RxFirebaseAuth { @NonNull public static Maybe<AuthResult> signInWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth, @NonNull final String email, @NonNull final String password) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseAuth.signInWithEmailAndPassword(email, password)); } }); }  @NonNull static Maybe<AuthResult> signInAnonymously(@NonNull final FirebaseAuth firebaseAuth); @NonNull static Maybe<AuthResult> signInWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth,
                                                               @NonNull final String email,
                                                               @NonNull final String password); @NonNull static Maybe<AuthResult> signInWithCredential(@NonNull final FirebaseAuth firebaseAuth,
                                                         @NonNull final AuthCredential credential); @NonNull static Maybe<AuthResult> signInWithCustomToken(@NonNull final FirebaseAuth firebaseAuth,
                                                          @NonNull final String token); @NonNull static Maybe<AuthResult> createUserWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth,
                                                                   @NonNull final String email,
                                                                   @NonNull final String password); @NonNull static Maybe<SignInMethodQueryResult> fetchSignInMethodsForEmail(@NonNull final FirebaseAuth firebaseAuth,
                                                                            @NonNull final String email); @NonNull static Completable sendPasswordResetEmail(@NonNull final FirebaseAuth firebaseAuth,
                                                     @NonNull final String email); @NonNull static Completable updateCurrentUser(@NonNull final FirebaseAuth firebaseAuth,
                                                     @NonNull final FirebaseUser newUser); @NonNull static Observable<FirebaseAuth> observeAuthState(@NonNull final FirebaseAuth firebaseAuth); @NonNull static Maybe<ActionCodeResult> checkActionCode(@NonNull final FirebaseAuth firebaseAuth,
                                                          @NonNull final String code); @NonNull static Completable confirmPasswordReset(@NonNull final FirebaseAuth firebaseAuth,
                                                   @NonNull final String code,
                                                   @NonNull final String newPassword); @NonNull static Completable applyActionCode(@NonNull final FirebaseAuth firebaseAuth,
                                              @NonNull final String code); @NonNull static Maybe<String> verifyPasswordResetCode(@NonNull final FirebaseAuth firebaseAuth,
                                                        @NonNull final String code); @NonNull static Completable addIdTokenListener(@NonNull final FirebaseAuth firebaseAuth,
                                                 @NonNull final FirebaseAuth.IdTokenListener idTokenListener); @NonNull static Completable removeIdTokenListener(@NonNull final FirebaseAuth firebaseAuth,
                                                    @NonNull final FirebaseAuth.IdTokenListener idTokenListener); }
RxFirebaseAuth { @NonNull public static Maybe<AuthResult> signInWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth, @NonNull final String email, @NonNull final String password) { return Maybe.create(new MaybeOnSubscribe<AuthResult>() { @Override public void subscribe(MaybeEmitter<AuthResult> emitter) throws Exception { RxHandler.assignOnTask(emitter, firebaseAuth.signInWithEmailAndPassword(email, password)); } }); }  @NonNull static Maybe<AuthResult> signInAnonymously(@NonNull final FirebaseAuth firebaseAuth); @NonNull static Maybe<AuthResult> signInWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth,
                                                               @NonNull final String email,
                                                               @NonNull final String password); @NonNull static Maybe<AuthResult> signInWithCredential(@NonNull final FirebaseAuth firebaseAuth,
                                                         @NonNull final AuthCredential credential); @NonNull static Maybe<AuthResult> signInWithCustomToken(@NonNull final FirebaseAuth firebaseAuth,
                                                          @NonNull final String token); @NonNull static Maybe<AuthResult> createUserWithEmailAndPassword(@NonNull final FirebaseAuth firebaseAuth,
                                                                   @NonNull final String email,
                                                                   @NonNull final String password); @NonNull static Maybe<SignInMethodQueryResult> fetchSignInMethodsForEmail(@NonNull final FirebaseAuth firebaseAuth,
                                                                            @NonNull final String email); @NonNull static Completable sendPasswordResetEmail(@NonNull final FirebaseAuth firebaseAuth,
                                                     @NonNull final String email); @NonNull static Completable updateCurrentUser(@NonNull final FirebaseAuth firebaseAuth,
                                                     @NonNull final FirebaseUser newUser); @NonNull static Observable<FirebaseAuth> observeAuthState(@NonNull final FirebaseAuth firebaseAuth); @NonNull static Maybe<ActionCodeResult> checkActionCode(@NonNull final FirebaseAuth firebaseAuth,
                                                          @NonNull final String code); @NonNull static Completable confirmPasswordReset(@NonNull final FirebaseAuth firebaseAuth,
                                                   @NonNull final String code,
                                                   @NonNull final String newPassword); @NonNull static Completable applyActionCode(@NonNull final FirebaseAuth firebaseAuth,
                                              @NonNull final String code); @NonNull static Maybe<String> verifyPasswordResetCode(@NonNull final FirebaseAuth firebaseAuth,
                                                        @NonNull final String code); @NonNull static Completable addIdTokenListener(@NonNull final FirebaseAuth firebaseAuth,
                                                 @NonNull final FirebaseAuth.IdTokenListener idTokenListener); @NonNull static Completable removeIdTokenListener(@NonNull final FirebaseAuth firebaseAuth,
                                                    @NonNull final FirebaseAuth.IdTokenListener idTokenListener);  }