RxFirebaseAuth { @CheckReturnValue @NonNull public static Completable sendPasswordResetEmail( @NonNull final FirebaseAuth instance, @NonNull final String email) { return RxTask.completes(new Callable<Task<Void>>() { @Override public Task<Void> call() throws Exception { return instance.sendPasswordResetEmail(email); } }); } private  RxFirebaseAuth(); @CheckReturnValue @NonNull static Observable<FirebaseAuth> changes(@NonNull FirebaseAuth instance); @CheckReturnValue @NonNull static Single<FirebaseUser> createUserWithEmailAndPassword(
            @NonNull final FirebaseAuth instance,
            @NonNull final String email, @NonNull final String password); @CheckReturnValue @NonNull static Single<List<String>> fetchProvidersForEmail(
            @NonNull final FirebaseAuth instance, @NonNull final String email); @CheckReturnValue @NonNull static Maybe<FirebaseUser> getCurrentUser(
            @NonNull final FirebaseAuth instance); @CheckReturnValue @NonNull static Completable sendPasswordResetEmail(
            @NonNull final FirebaseAuth instance, @NonNull final String email); @CheckReturnValue @NonNull static Single<FirebaseUser> signInAnonymous(
            @NonNull final FirebaseAuth instance); @CheckReturnValue @NonNull static Function<AuthResult, FirebaseUser> authToUserFunction(); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithCredential(
            @NonNull final FirebaseAuth instance, @NonNull final AuthCredential credential); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithCustomToken(
            @NonNull final FirebaseAuth instance, @NonNull final String token); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithEmailAndPassword(
            @NonNull final FirebaseAuth instance,
            @NonNull final String email, @NonNull final String password); @CheckReturnValue @NonNull static Completable signOut(@NonNull final FirebaseAuth instance);  }
@Test public void testSendPasswordResetEmail() { when(mockFirebaseAuth.sendPasswordResetEmail("email")) .thenReturn(mockSendPasswordResetEmailTask); mockSuccessfulSendPasswordResetEmailResult(); TestObserver obs = TestObserver.create(); RxFirebaseAuth .sendPasswordResetEmail(mockFirebaseAuth, "email") .subscribe(obs); callOnComplete(mockSendPasswordResetEmailTask); obs.dispose(); verify(mockFirebaseAuth) .sendPasswordResetEmail("email"); obs.assertNoErrors(); obs.assertComplete(); }
@Test public void testSendPasswordResetEmail_NotSuccessful() { when(mockFirebaseAuth.sendPasswordResetEmail("email")) .thenReturn(mockSendPasswordResetEmailTask); mockNotSuccessfulSendPasswordResetEmailResult(new IllegalStateException()); TestObserver obs = TestObserver.create(); RxFirebaseAuth .sendPasswordResetEmail(mockFirebaseAuth, "email") .subscribe(obs); callOnComplete(mockSendPasswordResetEmailTask); obs.dispose(); verify(mockFirebaseAuth) .sendPasswordResetEmail("email"); obs.assertError(IllegalStateException.class); }